在运行时将控件添加到属性表(没有对话框模板)
据我所知,通常在 Win32(我使用 API,而不是 MFC)编程中创建属性表的方式是为每个选项卡页提供一堆对话框模板,然后用它们制作属性表。我已经读过有关“在内存中”创建对话框模板的内容,但我不想这样做。如何在运行时以编程方式将控件添加到属性表,就像您可以创建一个 BUTTON
并在运行时将其添加到窗口一样?
As far as I can see, the way you normally create Property Sheets in Win32 (I am using the API, not MFC) programming is you have a bunch of dialog templates for each tab page, and you make the property sheet out of them. I have read about creating Dialog Templates 'in memory' but I would prefer not to do it this way. How do you add controls to a Property Sheet programatically at runtime, just like you can create a BUTTON
and add it to a Window at runtime?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您创建一个空白模板并将其链接到您的应用程序。然后,您可以使用 CreatePropertySheetPage 创建属性表然后根据需要向该属性表添加和删除控件。
如果您绝对必须使用在内存中动态构建的模板,并且无法将资源链接到您的应用程序,那么您需要 DLGTEMPLATE 结构。
I suggest that you create a blank template and link that to your app. You can then create the property sheet with CreatePropertySheetPage and then add and remove controls to that property sheet as you please.
If you absolutely have to use a template built on the fly in memory, and you can't bring yourself to link a resource to your app, then you need the DLGTEMPLATE structure.