EDIT中 按回车 焦点就跑了
怎么办
在.net平台中 属性设置中MUL怎么没用
怎么办
在.net平台中 属性设置中MUL怎么没用
解决方案 »
- CreateProcess创建了一个文件,怎么老删不掉
- 如何分析程序
- 各位大侠,请问如何在view中拖动用GDI+绘制出来的图形,并能处理双击和右击该图形的事件?
- 有没有目录类
- 小问题,CMSFlexGrid类控件,如何将单元格设置为可直接修改的格式?
- 特别的问题希望你来答复
- 关于打印中止处理的问题(讲的好的,我额外送)
- 怎么样才能增加工具栏里的工具??
- vs2005中的Microsoft.VC80.CRT.manifest和Microsoft.VC80.OpenMP.manifest版本号不一致
- 如何建立类似资源管理器中的ListView的列标头?
- 将编辑框中的数据记录到double weight[]数组
- 关于数据库的时间存入问题
ComboBox属性的可编辑属性怎么设置
m_combo.GetWindowRect(rc);
m_combo.SetWindowPos(NULL, 0, 0, rc.Width(), rc.Height()+100, SWP_NOMOVE |SWP_NOZORDER);
得到的子窗口数目为 0
如果能得到他的EDIT 窗口
pcomboedit=(CEdit*)pComboBox->GetWindow(GW_CHILD)
pcomboedit->SetReadOnly(0);
就可以拉
但为什么得不到子窗口我的pComboBox是从ComboBox继承下来的
#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__
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();
}