在InitDialog中设置焦点不起作用 SETFOCUS
来源:互联网 发布:知无涯者 百度云 编辑:程序博客网 时间:2024/04/30 22:22
参考以下帖子,
解决
http://topic.csdn.net/t/20030515/09/1785909.html
在WM_SHOWWINDOW中试试
void CTestdlg3Dlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
CEdit* pedit=(CEdit*)GetDlgItem(IDC_EDIT);
pedit-> SetFocus();
}
在InitDialog中要设置某个控件的焦点,必须返回FALSE
BOOL CODBCLiborDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//……
CButton* pButton = static_cast <CButton*> (GetDlgItem(IDC_BTN));
ASSERT(pButton != NULL);
pButton-> SetFocus();
return FALSE;
}
我用的第二种方法
因为在第二种方法,有如下提示:
BOOL CDialogLogin::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
- 在InitDialog中设置焦点不起作用 SETFOCUS
- 在InitDialog中设置焦点不起作用 SETFOCUS
- OnInitDialog()中SetFocus()不起作用解决方法
- Flex中如何利用FocusManager类的setFocus函数,设置TextInput的焦点
- Flex中如何利用FocusManager类的setFocus函数,设置TextInput的焦点
- Flex中如何利用FocusManager类的setFocus函数设置TextInput的焦点的例子
- vc mfc Edit SetFocus 设置焦点 无效 失败
- CTreeCtrl::Setcheck()在InitDialog解决方案
- 如何在对话框中设置默认焦点
- silverlight在XAML中设置控件焦点
- 在onExit中使用setFocus时出现无光标的问题
- 解决vs2005 在 ie8 中 设置断点不起作用
- 解决vs2005 在 ie8 中 设置断点不起作用 .
- MFC中设置焦点
- 屏幕中设置焦点
- SetFocus()
- SetFocus
- SetFocus
- C#中FileInfo类操作文件实例
- 黑莓自定义HorizontalFieldManager
- 如何承接软件外包项目
- java对象序列化学习笔记
- linux 审计
- 在InitDialog中设置焦点不起作用 SETFOCUS
- 搜索引擎早期重要论文推荐系列【3】In-memory URL Compression
- linux命令
- Oracle数据操作和控制语言详解
- Could not obtain connection to any of these urls:
- mssql 2000数据库时间长了,日志文件就会增大,清理日志
- 关于'GetModuleHandleEx': identifier not found
- [整理]集成SSH后,DAO工具类
- Struts2,spring&JPA(Hibernate)的集成