在对话框第一次弹出时设置控件焦点
来源:互联网 发布:淘宝上买iphone可靠吗 编辑:程序博客网 时间:2024/05/21 22:18
virtual BOOL OnInitDialog( );
Return Value
Specifies whether the application has set the input focus to one of the controls in the dialog box. If OnInitDialog returns nonzero, Windows sets the input focus to the first control in the dialog box. The application returns zero only if it has explicitly set the input focus to a control in the dialog box
Return Value
Specifies whether the application has set the input focus to one of the controls in the dialog box. If OnInitDialog returns nonzero, Windows sets the input focus to the first control in the dialog box. The application returns zero only if it has explicitly set the input focus to a control in the dialog box
比如我要在对话框第一次弹出来的时候,将焦点设置在Edit控件上,做法如下:
假设控件ID为 IDC_EDIT_TEXT
在OnInitdialog函数中添加如下语句:
GetDlgItem(IDC_EDIT_URL)->SetFocus();
也可以用
(CEdit *)GetDlgItem(IDC_EDIT_URL)->SetFocus();
然后函数返回False
必须要让OnInitDialog函数返回False,否则焦点设置无效。
必须要让OnInitDialog函数返回False,否则焦点设置无效。
- 在对话框第一次弹出时设置控件焦点
- 点击edit控件弹出对话框,焦点不在该对话框上时,对话框摧毁
- 对话框设置焦点在edit
- 如何在对话框中设置默认焦点
- WINDOWS7下模态对话框弹出时焦点不在对话框的解决办法
- Android 弹出对话框 且焦点在确认或者取消
- 在jsp中设置点击某事件时弹出对话框
- 设置输入法弹出时,处于焦点状态的控件所在界面保持原样
- 关于对话框OnInitDialog里设置edit控件输入焦点问题
- silverlight在XAML中设置控件焦点
- 弹出对话框并切换焦点
- 设置对话框打开时焦点位置
- MFC对话框设置焦点
- textField 获得焦点 弹出对话框,失去焦点关闭对话框
- 窗口启动时设置控件焦点
- 设置控件焦点
- 设置控件焦点
- WinForm设置控件焦点
- JAVA学习笔记之三Applet程序
- Yes语言编译器发布了!!!(有新情况)
- java学习杂谈(二)
- 手机常用博客网
- 对话框的关闭与对象的消亡
- 在对话框第一次弹出时设置控件焦点
- sso单点登录1
- java学习杂谈(三)
- 号外!! CSDN 女程序员、女ITer、 集合报到帖! 男士请旁观,谢谢合作。
- [美味菜谱]蒜香回锅肉
- sso单点登录2
- CString Format一个LONGLONG型数据
- SendMessage消息参数的用法
- C#入门经典 第26章 源码 2.版本1