我在我的项目中使用 CComboBox。我想在焦点上更改边框组合框的颜色
1 回答
0
最后它完成了,它有一个非常简单的解决方案。我只是重写了控件的 onpaint 方法。
void CComboBoxOwn::OnPaint()
{
CDC *dc = m_Parent->combobox->GetDC();
CRect rc;
m_Parent->combobox->GetClientRect(rc);
HBRUSH hBrush = CreateSolidBrush(COLORREF(RGB(255, 0, 0)));
FrameRect(dc->m_hDC, rc, hBrush);
DeleteObject(hBrush);
ReleaseDC(dc);
return;
}
于 2016-12-30T05:59:40.070 回答