EDIT中 按回车 焦点就跑了 
怎么办
在.net平台中 属性设置中MUL怎么没用

解决方案 »

  1.   

    知道了 wangenter属性另一个问题
     ComboBox属性的可编辑属性怎么设置
      

  2.   

    用SetWindowPos把控件的高度设大些
    m_combo.GetWindowRect(rc);
    m_combo.SetWindowPos(NULL, 0, 0, rc.Width(), rc.Height()+100, SWP_NOMOVE |SWP_NOZORDER);
      

  3.   

    还是不行 我用int k=pComboBox->GetWindowedChildCount();
    得到的子窗口数目为 0 
    如果能得到他的EDIT 窗口
    pcomboedit=(CEdit*)pComboBox->GetWindow(GW_CHILD)
    pcomboedit->SetReadOnly(0); 
    就可以拉
    但为什么得不到子窗口我的pComboBox是从ComboBox继承下来的
      

  4.   


    #ifndef __CJFLATCOMBOBOX_H__
    #define __CJFLATCOMBOBOX_H__#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000// CCJComboBox is a CComboBox derived class which is simular to
    // the flat combobox as seen in the Microsoft office products.
    class CCJFlatComboBox : public CComboBox
    {
    DECLARE_DYNAMIC(CCJFlatComboBox)public:
    LOGFONT m_lf;
    CFont m_font; void ReconstructFont();
    void SetFontName(const CString& strFont);
    void SetFontBold(BOOL bBold);
    void SetFontUnderline(BOOL bSet);
    void SetFontItalic(BOOL bSet);
    void SetFontSize(int nSize); CString GetFontName();
    BOOL GetFontB();
    BOOL GetFontU();
    BOOL GetFontI();
    int GetFontSize();
    CStringArray aryData; // Default constructor
    //
    CCJFlatComboBox(); // Virtual destructor
    //
    virtual ~CCJFlatComboBox();protected: int m_nOffset; // offset used during paint.
    BOOL m_bLBtnDown; // TRUE if left mouse button is pressed
    BOOL m_bPainted; // used during paint operations
    BOOL m_bHasFocus; // TRUE if control has focus
    BOOL m_bAutoComp; // Used by Autocompleting.
    COLORREF m_clrBtnHilite; // set to the system color COLOR_BTNHILIGHT
    COLORREF m_clrBtnShadow; // set to the system color COLOR_BTNSHADOW // enum used to determine the state the combo box should be
    //
    enum STATE { normal = 1, raised = 2, pressed = 3, focus=4 };public:
    void SetFontLog(LOGFONT& plf, int nType=1);
    BOOL SetCurLsh(LPCTSTR sCurLsh);
    CString GetCurLsh();
    long InsertString1(long nIndex, LPCTSTR sText, LPCTSTR sLsh);
    CString GetLsh(long nIndex);
    long AddString1(LPCTSTR sText, LPCTSTR sLsh);
    void Reset();
    // Call this member function to enable auto completion.
    //
    void EnableAutoCompletion(BOOL bEnable=TRUE);
    COLORREF m_clrBtnFace; // set to the system color COLOR_BTNFACEprotected: // this member function is called by the combo box whenever a paint
    // operation should occur.
    //
    void DrawCombo(STATE eState, COLORREF clrTopLeft, COLORREF clrBottomRight);// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CCJFlatComboBox)
    public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    //}}AFX_VIRTUAL // Generated message map functions
    protected:
    //{{AFX_MSG(CCJFlatComboBox)
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnTimer(UINT nIDEvent);
    afx_msg void OnPaint();
    afx_msg void OnSetFocus();
    afx_msg void OnKillFocus();
    afx_msg void OnEditUpdate();
    afx_msg void OnSysColorChange();
    afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
    //}}AFX_MSG DECLARE_MESSAGE_MAP()
    };/////////////////////////////////////////////////////////////////////////////
    // Inline Functions
    /////////////////////////////////////////////////////////////////////////////inline void CCJFlatComboBox::EnableAutoCompletion(BOOL bEnable/*=TRUE*/)
    { ASSERT(::IsWindow(m_hWnd)); m_bAutoComp = bEnable; }//{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // __CJCOMBOBOX_H__
      

  5.   


    CInPlaceComboBox从上个类继承下来的
    这是他的构造函数CInPlaceComboBox::CInPlaceComboBox(CDiagramEntity *pOwner, CWnd* pParent, CRect& rect, UINT nID,int nRow, int nColumn, UINT nFirstChar)
    :m_ft(0)
    { m_pOwner = pOwner;    m_nRow          = nRow;
        m_nColumn       = nColumn;    DWORD dwEditStyle = WS_CHILD|WS_VISIBLE|CBS_SIMPLE| CBS_AUTOHSCROLL | CBS_DROPDOWN|CBS_NOINTEGRALHEIGHT|CBS_DROPDOWNLIST;
    //DWORD dwEditStyle = CBS_SIMPLE|CBS_DROPDOWNLIST;    //整个ComboBox的尺寸
    rect.bottom=rect.bottom+200;
        if (!Create(dwEditStyle, rect, pParent, nID))
    return; ShowWindow(1);
        SetFocus();

    }