Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  2. {
  3.  
  4. if (listBox1.Items.Count > 0 && listBox1.SelectedItem!=null) {
  5.  
  6. Pracownik p = (Pracownik)listBox1.SelectedItem;
  7.  
  8. string imie = textImie.Text;
  9. string nazwisko = textNazwisko.Text;
  10. string pesel = textPesel.Text;
  11. string wzrost = textWzrost.Text;
  12. string stanowisko = textStanowisko.Text;
  13.  
  14. textImie.Text = p.Imie.ToString();
  15. textNazwisko.Text = p.Nazwisko.ToString();
  16. textPesel.Text = p.Pesel.ToString();
  17. textWzrost.Text = p.Wzrost.ToString();
  18. textStanowisko.Text = p.Stanowisko.ToString();
  19. }
  20. else
  21. {
  22. MessageBox.Show("lista jest pusta");
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement