开发者

Visual C++ ListBox as Preference Chooser

开发者 https://www.devze.com 2023-03-09 16:08 出处:网络
So I\'m building a tool that allows a user to edit a whole bunch of preferences for various things. There are several groups of settings, too many to use a TabControl without creating arrow sliders to

So I'm building a tool that allows a user to edit a whole bunch of preferences for various things. There are several groups of settings, too many to use a TabControl without creating arrow sliders to view all of the tabs, so I decided I would try and use a ListBox to list the groups of preferences, and then when they click on them, the settings that they can change show up to the right of the box.

I'm just not sure how to do this. Obviously it would invoke something in the OnSelectionChanged function of the ListBox, but I'm not sure where to go from there. Surely a dialog can have dynamic design, right? Would I mimic the creation of a tabbed-dialog开发者_开发问答 where I create my designs and then bind them to the TabControl, and just do something similar for the ListBox? Again, it's not the ListBox itself that is dynamic. The user will click on "Settings A" from the ListBox, and to the right of the ListBox will be settings 1, 2, and 3 that each have textboxs/radios/checks.

Any hints on how I can accomplish this? I just think it looks nicer than having a whole bunch of tabs lined up across the top of the box. Thanks in advance to any brilliant minds who can help me out. I'm versed in C++, but I'm very much a beginner at VC++.


You can a vertical splitter with two panes:

  • one which contains the list
  • another one which contains the configuration dialogs you would normally use in a tab control

Each time the list selection changes you can load the appropriate dialog in the right pane. You can find a splitter tutorial here: http://www.codeproject.com/KB/wtl/wtl4mfc7.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消