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

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

问题描述

我在GUI应用程序中使用了Tab控件,并且我知道如何从中添加和删除选项卡(TCM_INSERTITEM等),但是我不知道如何向选项卡(如Buttons等)中添加其他控件。您将控件添加到选项卡? (请注意,我不是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天全站免登陆