向对话框添加动态自定义控件 [英] Adding Dynamic Custom Control to Dialog

查看:99
本文介绍了向对话框添加动态自定义控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C ++对话框,其中包含:

1.)ListBox
2.)3个复选框
3.)两个树控件和
4.)5个按钮.

我有点不得不将ListBox和两个Checkbox移到另一个类中,并且应该在创建对话框时动态地添加该类(带有两个Listbox和两个Checkbox的Cutom控件).

有没有很好的例子呢?我已经看到了很多代码项目的示例,但是实际上所有事情都是使用CWnd :: Create函数动态创建的自定义控件.

但是我要创建一个以上的控件(一个自定义类控件,其中包含列表框的三个不同控件和两个复选框).

我该怎么做呢?

I have a C++ dialog, which contains:

1.) ListBox
2.) 3 checkboxes
3.) Two tree controls and
4.) 5 buttons.

I kind of have to move, the ListBox and the two Checkboxes into a different class and should add this class(the cutom control with two listboxes and two checkboxes) dynamically at the time of creation of the dialog.

Is there any good example for this. I have seen so many examples of code project, but everything is actually creating a custom control dynamically using the CWnd::Create function.

But i have more than one control to create (a custom class control with three different control of listbox and 2 checkboxes).

How do i do this? is there any nice example?

推荐答案

您总是可以通过简单的方法来创建带有这三个控件的对话框,然后将该对话框插入n次. >
在这里看看: link1 [ link2 [ ^ ].

如果该方法对您有用,那么您始终可以在搜索子对话框"时寻求更多帮助.

希望这对您有所帮助. :thumbsup:
You could always do it the easy way and create a dialog with those three controls and then insert that dialog n times.

Take a look here: link1[^], and link2[^].

If that approach could work for you you can always look for more help searching for "child dialog".

Hope this helps you. :thumbsup:


这篇关于向对话框添加动态自定义控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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