按钮控制,始终在停靠对话框栏中禁用 [英] button control, is always disabled in Docking Dialog bar

查看:84
本文介绍了按钮控制,始终在停靠对话框栏中禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个MFC SDI项目,并在其上创建了一个Docking Dialog栏,其中包含一些控件

。其中一个控件,即按钮控件,始终处于禁用状态。我已经尝试了

我能想到的所有内容都可以启用它。

GetDlgItem(IDC_SQLQUERY) - > EnableWindow(TRUE);

非常感谢任何建议或帮助

I created a MFC SDI project and made a Docking Dialog bar with some controls
on it. One of the controls, button control, is always disabled. I have tried
everything that I can think of to make it enabled.
GetDlgItem( IDC_SQLQUERY )->EnableWindow(TRUE);
Any suggestions or help would be greatly appreciated

推荐答案

这可能是由于MFC的OnCmdUI机制造成的。对于每个按钮和菜单项MFC测试是否有某人回答控件ID,如果没有,则禁用按钮或菜单项。因此,只要您创建按钮ID的句柄,该按钮就会启用。
This might be due to the OnCmdUI mechanism of MFC. For every button and menu entry MFC tests whether there is "someone" that answer to the control ID, and if not, disables the button or menu entry. Hence, as soon as you create a handle of the button's ID, the button should become enabled.


这篇关于按钮控制,始终在停靠对话框栏中禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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