Reputation: 33
I wonder how to create mechanism which create new checkbox below previous when you click on button. Number of checkboxes are unlimited. I don't think that table of objects work well, so I think about implementation in list of objects. Any suggestions?
Upvotes: 0
Views: 227
Reputation: 18421
What would you do with unlimited number of check boxes - confuse the user? So, that he/she wouldn't attempt to use it again? Bad idea, as you can guess now.
You may (should) limit the number of check boxes (or better, limit the number of controls on form/dialog). IMO, more than 10-12 CBs would be cumbersome for the end user. Therefore, better idea is to have all of them on dialog/dialog-resource, and make all of them invisible/disabled. When user does some action, make them visible/enabled - so that end user may do something with it.
Still demand N number of CBs, where N is not determined beforehand? Then you may have checkboxes under Combo box, or use check-boxes under List Control. List Control already hosts this feature, but for CBs under Combo, you may need to write your own class.See this article as an example.
Upvotes: 0
Reputation: 10820
Here is what I would do:
OnBtnClick
)OnBtnClick
is called you do:
Depending on the GUI framework used the bottom details may vary but the idea remains the same. I did this with wxWidgets, QT and MFC but I don't know which framework you use. You should be able to find code samples for each framework.
Upvotes: 1