向控件添加成员变量的问题 [英] Problems adding member variables to controls

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

问题描述

我刚刚开始使用Sams出版''在21天内自学Visual C ++ 4',在Windows XP机器上使用VC ++ 4.0版。当我尝试将成员变量添加到通过类向导,成员变量选项卡添加到对话框的控件时,会出现问题。我只能看到最初由MFC应用程序向导创建的两个按钮控件的控件ID - 确定和取消,尽管删除了这两个控件并添加了三个新的按钮控件,两个复选框控件和一个编辑框控件。我是否需要在成员变量选项卡中刷新控件ID列表,因为目前我无法将变量分配给任何控件?

非常感谢,

radders

I''ve just started working through Sams publishing''s "Teach yourself Visual C++ 4 in 21 days", using VC++ version 4.0 on a windows xp machine. My problem occurs when I attempt to add member variables to controls that I have added to a dialog box through the Class Wizard, Member Variables tab. I can only see the Control IDs of the two Push Button Controls that are initially created by the MFC App Wizard - Ok and Cancel, despite having deleted these two controls and added three new Push Button Controls, two Check Box Controls and an Edit Box Control. Is there something that I have to do to refresh the list of Control IDs in the Member Variables tab, as currently I cannot assign variables to any controls?
Thank you very much,
radders

推荐答案


我刚刚开始通过Sams发布''s'教你自己视觉在21天内使用C ++ 4,在Windows XP机器上使用VC ++ 4.0版。当我尝试将成员变量添加到通过类向导,成员变量选项卡添加到对话框的控件时,会出现问题。我只能看到最初由MFC应用程序向导创建的两个按钮控件的控件ID - 确定和取消,尽管删除了这两个控件并添加了三个新的按钮控件,两个复选框控件和一个编辑框控件。我是否需要在成员变量选项卡中刷新控件ID列表,因为目前我无法将变量分配给任何控件?

非常感谢,

radders
I''ve just started working through Sams publishing''s "Teach yourself Visual C++ 4 in 21 days", using VC++ version 4.0 on a windows xp machine. My problem occurs when I attempt to add member variables to controls that I have added to a dialog box through the Class Wizard, Member Variables tab. I can only see the Control IDs of the two Push Button Controls that are initially created by the MFC App Wizard - Ok and Cancel, despite having deleted these two controls and added three new Push Button Controls, two Check Box Controls and an Edit Box Control. Is there something that I have to do to refresh the list of Control IDs in the Member Variables tab, as currently I cannot assign variables to any controls?
Thank you very much,
radders



您是否通过右键单击类视图窗格中的对话框类来通过对话框添加控制变量?

Hi are you adding control variables via the dialog box from right clicking your dialog box class in the class view pane?



您是否通过右键单击类视图窗格中的对话框类,通过对话框添加控制变量?
Hi are you adding control variables via the dialog box from right clicking your dialog box class in the class view pane?



你好willakawill

不,我没有那样添加控制变量。手册中描述的方式是通过类向导将一个新变量添加到我试图使用它的控件的控件ID中


我现在添加了一个名为:m_TestEdit的变量类型:CString到我的对话框类,但它仍然没有显示在类向导的成员变量选项卡中,所以我如何将新添加的变量(m_TestEdit)附加到我用ID创建的编辑框:IDC_TEST_EDIT so我可以用变量m_TestEdit控制从编辑框读取/写入的内容吗?


谢谢,Radders

Hi willakawill
No, I hadn''t been adding the control variables that way.The way it was described in the manual was to add a new variable to the Control ID of the control with which I am trying to use it, through the Class Wizard

I have now added a variable named: m_TestEdit of type: CString to my dialogue box class, but it still doesn''t show up in the Member Variables tab of the Class Wizard, so how do I go about attaching the newly added variable (m_TestEdit) to the edit box I created with ID: IDC_TEST_EDIT so that I can control what is read from/written to the edit box with the variable m_TestEdit?

Thanks, Radders



嗨willakawill

不,我没有按照这种方式添加控制变量。手册中描述的方式是向控件ID添加一个新变量我试图使用它的控件,通过类向导


我现在已经在我的对话框类中添加了一个名为:m_TestEdit的类型:CString的变量,但它仍然没有显示在成员变量选项卡中类向导,那么如何将新添加的变量(m_TestEdit)附加到我使用ID:IDC_TEST_EDIT创建的编辑框中,以便我可以使用变量m_TestEdit控制从编辑框读取/写入的内容?


谢谢,Radders
Hi willakawill
No, I hadn''t been adding the control variables that way.The way it was described in the manual was to add a new variable to the Control ID of the control with which I am trying to use it, through the Class Wizard

I have now added a variable named: m_TestEdit of type: CString to my dialogue box class, but it still doesn''t show up in the Member Variables tab of the Class Wizard, so how do I go about attaching the newly added variable (m_TestEdit) to the edit box I created with ID: IDC_TEST_EDIT so that I can control what is read from/written to the edit box with the variable m_TestEdit?

Thanks, Radders



您是否将其添加为控制变量?

Did you add it as a control variable?


这篇关于向控件添加成员变量的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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