Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. class objectA
  2. {
  3. class objectZ
  4. {
  5. public int Count { get; set; }
  6. }
  7. class objectX
  8. {
  9. public string Prop1 { get; set; }
  10. public bool Prop2 { get; set; }
  11. }
  12.  
  13. public string Name { get; set; }
  14. public objectZ Z { get; set; }
  15. public List<objectX> listX { get; set; }
  16. }
  17.  
  18. BindingList<objectA> listA = new BindingList<objectA>();
  19. comboBox_1.DataSource = listA;
  20. comboBox_1.DisplayMember = "Name";
  21.  
  22. textBox_1.Text = listA.GetWantedObjectX().Prop1;
  23. checkBox_1.Checked = listA.GetWantedObjectX().Prop2;
  24.  
  25. void checkBox_1_CheckedChanged()
  26. {
  27. listA.GetWantedObjectX().Prop2 = checkBox_1.Checked;
  28. }
  29.  
  30. currentObject = listA.GetWantedObjectX();
  31. checkBox_1.Checked = currentObject.Prop2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement