本人做的应用程序操作是有按扭来控制的!
当TAB切换到COMBOBOX的时候下拉列表不会自动弹出
请问有什么办法可以实现当TAB移动到该控件的时候弹出下拉列表
急急急急急急

解决方案 »

  1.   

    写以CComboBox为基类的自定义类,例如类名为CMyc,然后重载OnSetFocus方法,加入代码:
    void CMyc::OnSetFocus(CWnd* pOldWnd) 
    {
    CComboBox::OnSetFocus(pOldWnd);
    this->ShowDropDown(TRUE);
    }
      

  2.   

    重载控件的OnSetFocus消息,在里面调用
    Shows or hides the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.void ShowDropDown(
       BOOL bShowIt = TRUE 
    );
    Parameters
    bShowIt 
    Specifies whether the drop-down list box is to be shown or hidden. A value of TRUE shows the list box. A value of FALSE hides the list box. 
    函数
      

  3.   

    试下在处理WM_SETFOCUS 消息时,给控件发送个CB_SHOWDROPDOWN消息,MFC用CComboBox::ShowDropDown(true);
      

  4.   


    void CXXXX::OnSetfocusCombo1() 
    {
    // TODO: Add your control notification handler code here
    ((CComboBox*)GetDlgItem(IDC_COMBO1))->ShowDropDown();
    }