コード例 #1
0
ファイル: Form1.cs プロジェクト: jchli07/COMP123
 private void InitializeGui()
 {
     premiers = new Dictionary <string, Premier>();
     foreach (var p in Premier.GetPremiers())
     {
         premiers.Add(p.GetKey(), p);
     }
     lstPremier.DataSource = new List <string>(premiers.Keys);
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jchli07/COMP123
        private void DisplayPremier(string key)
        {
            //get the premier object
            Premier p = premiers[key];

            //sets the name label
            lblName.Text = p.name;
            //sets the birth label
            lblBirth.Text = p.birth;
            //sets the office label
            lblOffice.Text = p.range;
            //sets the picture box
            picPremier.Image = Image.FromFile(string.Format("P:\\NPERSH\\COMP123\\images\\{0}.jpg", key));
            MessageBox.Show(@"P:\NPERSH\COMP123\images\" + key + ".jpg", //what to show
                            "Narendra Title",                            //title of the window
                            MessageBoxButtons.OK,                        //the buttons to show
                            MessageBoxIcon.Exclamation);                 //the icons to show
        }