创建 MFC 对话框成员后如何修改它?
我使用向导创建了一个带有 OK
和 Cancel
的 baisc 输入框,
我将输入框类型设置为“int”,最小值为 0,最大值为 99。
现在我想编辑输入框,使其类型为字符串。
我打开了 MFC 类向导,可以看到输入框的 ControlID、类型和成员 ID。但是,没有选项可以对其进行编辑...
我怎样才能通过向导执行此操作而不弄乱生成良好的代码?
谢谢!
Visual Studio 6.0 - C++
I used the Wizard to create a baisc input box with a OK
and Cancel
I made the input box type "int" with min value 0 and max 99.
Now I want to edit the input box so that it is type string.
I have the MFC ClassWizard open and can see the ControlID, Type, and Member ID of the input box. However, there is no option to edit it...
How can I do this through the Wizard and not mess up the nicely generated code?
Thanks!
Visual Studio 6.0 - C++
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法可能是删除当前与控件关联的变量(使用 ClassWizard,并手动删除函数实现),然后创建一个新的 CString 类型变量与之关联。请注意,无论好坏,您都无法将字符串限制在数字范围内 - 您只能限制其长度。
The easiest way is probably to delete the variable that's currently associated with the control (using the ClassWizard, and deleting the function implementation by hand) and then creating a new variable to associate with it of type
CString
. Note that, for better or worse, you will not be able to limit the string to a numeric range -- you can only limit its length.