Exemple #1
0
        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);
        }
Exemple #2
0
        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",
                            "James Li",                       //title of the window
                            MessageBoxButtons.OK,             //the buttons to show
                            MessageBoxIcon.Exclamation);      //the icons to show
        }