如何将变量添加到动态创建的静态控件 [英] How to add a variable to dynamically created static controls

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

问题描述

我正在使用Visual Studio 2008.我有一个基于MFC对话框的应用程序,可以在单击按钮时动态创建静态控件。现在我需要为这些控件添加一个变量。请帮我解决这个问题。   

解决方案

从CStatic(例如,CMyStatic)派生您自己的类,然后使用类向导通过单击"添加自定义"按钮添加所需的成员变量 例如,



然后添加成员变量 -



I am using Visual Studio 2008. I have an MFC dialog based application that creates static controls dynamically on clicking on to a button. Now I need to add a variable to those controls. Please help me to solve this out.   

解决方案

Derive your own class from CStatic (e.g., CMyStatic) and then use class wizard to add the desired member variable by clicking the Add Custom button.  For example,

and then add the member variable -


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

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