//这是WM_PAINT消息的处理
void CMyComboBox::OnPaint() 
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here CRect rcClient;
GetClientRect(&rcClient); // Let the window do its default painting...
CWnd::DefWindowProc( WM_PAINT, (WPARAM)dc.GetSafeHdc(), 0 );

// Do not call CComboBox::OnPaint() for painting messages
}
void CMyComboBox::OnMouseMove(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default
if (FALSE == m_bOver)
{
m_bOver = TRUE;
SetCapture(); //捕获鼠标以监视鼠标是否已经离开编辑框
Invalidate();
} CRect rcClient;
GetClientRect(&rcClient);
if (rcClient.PtInRect(point) == FALSE)
{
m_bOver = FALSE;
GetParent()->Invalidate();
ReleaseCapture();
} CComboBox::OnMouseMove(nFlags, point);
}
BOOL CMyComboBox::OnEraseBkgnd(CDC* pDC) 
{
// TODO: Add your message handler code here and/or call default
return TRUE;
}这样绘制下拉框会有问题,就是点击右边那个按钮的时候,下拉框总是显示一下就消失了,很是不明白
关于控件自绘的东西不是很理解,希望高手指点一下
答案好,我加分