Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void AddContact(string Contact_name, string email, bool selected = false, string path="")
- {
- // Create a new ContactListItem and set the required parameters with the "Add" method.
- ContactListItem contact_item = new ContactListItem();
- contact_item.Add(Contact_name, email,selected,path);
- // Then set the ContactListItem's Dock property to "Top".
- contact_item.Dock = DockStyle.Top;
- // Add the ContactListItem to the Panel.
- panel1.Controls.Add(contact_item);
- // Finally, bring the ContactListItem to the front to avoid disarrangements.
- contact_item.BringToFront();
- }
- // Add a list of pre-defined ContactListItems.
- public void AddContacts()
- {
- AddContact("Visual Idiot", "Vi@su.al",false, @"C: \Users\Beckie\Pictures\avatars\avatar-one.jpg");
- AddContact("Kerem Suer", "Kerem@kerem.co",false, @"C:\Users\Beckie\Pictures\avatars\avatar-two.jpg");
- AddContact("Josh Hamsley", "Josh@hamsley.com",false, @"C:\Users\Beckie\Pictures\avatars\avatar-three.jpg");
- AddContact("Fabio", "fabio@ffabs.com",false, @"C:\Users\Beckie\Pictures\avatars\avatar-four.jpg");
- AddContact("Anthony Lagoon", "anthony@lagoon.co",false, @"C:\Users\Beckie\Pictures\avatars\avatar-five.png");
- AddContact("Jenny Shen", "jen@shen.co",false, @"C:\Users\Beckie\Pictures\avatars\avatar-six.png");
- AddContact("Charlie Waite", "charlie@focuslab.com",false, @"C:\Users\Beckie\Pictures\avatars\avatar-seven.png");
- AddContact("Ed Wellbrook", "El@wb.co",false, @"C:\Users\Beckie\Pictures\avatars\avatar-eight.png");
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- AddContacts();
- AddList();
- }
Add Comment
Please, Sign In to add comment