如何将控件添加到 Tab 控件 [英] How to add controls to a Tab control

查看:22
本文介绍了如何将控件添加到 Tab 控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 GUI 应用程序中使用选项卡控件,并且我知道如何从中添加和删除选项卡(TCM_INSERTITEM 等),但我不知道如何将其他控件添加到按钮等选项卡.如何您将控件添加到选项卡?(注意我不是 PropertySheet 控件,而是 Tab 控件.)

I am using a Tab control in my GUI app and I know how to add and remove tabs from it (TCM_INSERTITEM, etc.) but I cannot figure out how to add other controls to a tab like Buttons, etc. How do you add controls to a tab? (Note that I am not a PropertySheet control, but a Tab control.)

推荐答案

如果你说的是向选项卡控件的主体添加控件:你没有.

If you are talking about adding controls to the body of the tab control: You don't.

您所做的是为每个选项卡创建一个子样式的对话框控件,其中将包含该选项卡的控件.选择每个选项卡后,您将处理来自选项卡控件的通知以创建和显示适当的页面控件.页面对话框通常是选项卡控件的父级,而不是选项卡控件本身.

What you do is create a child styled dialog control for each tab, which will have the controls for that tab on it. As each tab is selected, you handle the notification from the tab control to create and show the appropriate page control. The page dialogs are normally parented to the parent of the tab control, not the tab control itself.

这篇关于如何将控件添加到 Tab 控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆