是否可以在运行时使用create为表单视图创建控件而不是将它们放在模板上? [英] Can controls be created at run time using create for a form view rather than using placing them on template?

查看:80
本文介绍了是否可以在运行时使用create为表单视图创建控件而不是将它们放在模板上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在运行时使用create为表单视图创建控件而不是将它们放在模板上吗?

表单类是否有一个HWND数据成员,可以指定为该成员的父成员在运行时创建的控件?



如果是,可以在此类控件上使用函数movewindow。

解决方案

您可以使用 CreateWindow API来创建窗口,对话框和控件。

与其他操作系统不同,Windows中的每个窗口都是窗口。

我在本文中做到了这一点 - Mousey!翻转和停放 [ ^ ]



该文章不使用MFC,但使用 CWnd :: Create 方法, CFormView 类间接继承。


我们有一篇关于这个论点的文章:使用RollOut窗口在运行时创建,定位,显示和隐藏控件 [ ^ ]。

Can controls be created at run time using create for a form view rather than using placing them on template?
Does the form class have an HWND data member that can be specified as the parent of the control created at run time?

If yes can the function movewindow be used on such control.

解决方案

You can use the CreateWindow API to create a window, dialog and controls.
Every thing is a window in Windows, unlike other OSs.
I've done just that in this article - Mousey! Roll Over and Park[^]

The article doesn't use MFC, but the same can be done using the CWnd::Create method, which the CFormView class indirectly inherits.


We have an article on this argument: "Create, Position, Show and Hide controls at Runtime using the RollOut Window"[^].


这篇关于是否可以在运行时使用create为表单视图创建控件而不是将它们放在模板上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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