Visual C++列表框作为首选项选择器

发布于 2024-11-11 06:00:01 字数 466 浏览 5 评论 0原文

因此,我正在构建一个工具,允许用户编辑各种事物的一大堆首选项。有几组设置,太多了,无法在不创建箭头滑块来查看所有选项卡的情况下使用 TabControl,因此我决定尝试使用 ListBox 来列出首选项组,然后当他们单击它们时,他们可以更改的设置显示在框的右侧。

我只是不知道该怎么做。显然它会调用 ListBox 的 OnSelectionChanged 函数中的某些内容,但我不确定从哪里开始。对话框当然可以有动态设计,对吗?我是否会模仿选项卡式对话框的创建,在其中创建我的设计,然后将它们绑定到 TabControl,然后对 ListBox 执行类似的操作?同样,ListBox 本身并不是动态的。用户将从列表框中单击“设置 A”,列表框的右侧将是设置 1、2 和 3,每个设置都有文本框/单选按钮/复选框。

关于我如何实现这一目标有任何提示吗?我只是觉得它看起来比在盒子顶部排列一大堆标签更好。预先感谢任何可以帮助我的聪明人。我精通 C++,但我在 VC++ 方面还是个初学者。

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++.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

私藏温柔 2024-11-18 06:00:01

您可以使用具有两个窗格的垂直拆分器:

  • 一个包含列表,
  • 另一个包含您通常在选项卡控件中使用的配置对话框

。每次列表选择更改时,您都可以在右窗格中加载相应的对话框。您可以在此处找到拆分器教程: http://www.codeproject.com/KB/wtl /wtl4mfc7.aspx

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文