Combobox ohne Border
-
das sollte doch irgend wie gehen. bei edit control ist geht das ja auch, ist sogar standard
-
The control ignores the WS_BORDER style and draws a border whether you like
it or not. Please mail complaints to bgates@microsoft.com.
-
-
in c++ mfc hab ich das so realiesiert
void CComboBoxD::OnPaint() { //_RPT0(_CRT_WARN, "OnPaint\n"); CPaintDC dc(this); CRect rc; GetClientRect(&rc); CSize p=GetBorderXY(); if (p.cx!=0 || p.cy!=0) { rc.DeflateRect(p); CRgn rgn; rgn.CreateRectRgnIndirect(&rc); dc.SelectClipRgn(&rgn); } DefWindowProc(WM_PAINT, (WPARAM)dc.GetSafeHdc() , 0); DrawBorder(NULL); } void CComboBoxD::DrawBorder(CDC* pDC) { if (m_tBorder==CBD_2DEx) { CDC* pDc=GetDC(); CRect rc; GetClientRect(&rc); rc.DeflateRect(GetBorderXY()); if (m_tTyp==CBT_Simple) { CRect xc; ::GetClientRect(m_tInfo.hwndList, &xc); rc.bottom =xc.bottom; //dirty } pDc->DrawEdge(&rc, BDR_SUNKENOUTER,BF_RECT | ((IsFocus() && m_bFlatOnFocus)?BF_FLAT:0)); ReleaseDC(pDc); } }
auf deutsch
clip border->DefWindowProc->(end || draw other border)
-
@vdittrich
Assertion error in DrawBorder when pDC == NULL
-
Funzt folgendes vielleicht?
void Remove3DStyleCombo( HWND hWndCb) { HWND hWndEdit = (HWND)::SendMessage( hWndCb, CBEM_GETEDITCONTROL, 0, 0)); if( hWndEdit) { DWORD dwExStyle = GetWindowLong( hWndEdit, GWL_EXSTYLE); SetWindowLong( hWndEdit, dwExStyle&~WS_EX_CLIENTEDGE); } }
-
@vdittrich
Assertion error in DrawBorder when pDC == NULLsorry @rene,
ich verwende pDC gar nicht, dafür aber CDC* pDc=GetDC();
-
@rene
Retrieves the handle to the edit control portion of a ComboBoxEx control. A ComboBoxEx control uses an edit box when it is set to the CBS_DROPDOWN style.
und CBS_DROPDOWNLIST ??,
ich habe lange gesucht und probiert, der border wird gezeichnet bei WM_PAINT.
aber:
void CComboBoxD::DrawBorder(CDC* pDC) war etwas sinnlos ...
-
@RenéG: Ne, geht nich.Auch nich bei CBS_DROPDOWN. <WebFurzi> scheint ausnahmsweise mal recht zu haben.