0

I have a GroupBox in a Form. In this GroupBox I have three Checkboxes that can be checked either one, two or three. I want the checked state to maintain after I close this form and reopen it. Is it something about the GroupBox that has to be taken into consideration? How can I do this? Thank you.

Vimal CK
  • 3,543
  • 1
  • 26
  • 47

1 Answers1

0

Create a custom class from the groupbox items. Add properties for each item, i.e. .checked

Store your object in a global variable. Before the form closes, update your global variable witht he current item structure and their checked properties.

On re-open of the form, load and prepare the groupbox from the custom object.

If your groupbox state needs to persist on application close, you will have to do the above, but use a database instead of a global variable.

Louis van Tonder
  • 3,664
  • 3
  • 31
  • 62