MFC CEidt获取焦点

MFC CEidt获取焦点

——————————————————————————————

BOOL   CMMDlg::OnInitDialog() 
{ 
     CDialog::OnInitDialog(); 

    //   Set   the   icon   for   this   dialog.     The   framework   does   this         automatically 
   //    when   the   application 's   main   window   is   not   a   dialog 
   SetIcon(m_hIcon,   TRUE);	 //   Set   big   icon 
   SetIcon(m_hIcon,   FALSE);	 //   Set   small   icon 

   //   TODO:   Add   extra   initialization   here 

   /在这里添加代码设置让控件获得焦点 
   GetDlgItem(IDC_EDIT)-> SetFocus(); 
    return   FALSE;     //  *******important ************ return   TRUE     unless   you   set   the   focus   to   a    control 
} 

posted @ 2011-04-13 15:18  Watson.Long  阅读(2479)  评论(0编辑  收藏  举报