combobox 处理回车

 

BOOL   CTest6Dlg::PreTranslateMessage(MSG*   pMsg)     
{   

	if(   pMsg->message   ==   WM_KEYDOWN   )   
	{                   
		switch(   pMsg->wParam   )   
		{   
		case   VK_RETURN:   
			CEdit   *pEdit   =   (CEdit*)m_combo1.GetWindow(GW_CHILD);   
			if(pMsg->hwnd   ==   pEdit->m_hWnd   )   
			{   
				GetDlgItem(IDC_EDIT1)->SendMessage(WM_KILLFOCUS,   0,   0);   
				GetDlgItem(IDC_EDIT2)->SetFocus();   

			}   

			return   TRUE;   

		}   
	}   
	return   CDialog::PreTranslateMessage(pMsg);   
}


你可能感兴趣的:(combobox 处理回车)