Выделите поверх статики в MFC
I have a rectangle on dialog box where I have some text. It is CBCGPStatic. I have a method OnMouseMove(UINT nFlags, CPoint point) which I want to use to highlight the area of this static. Is any way to do it?
Что я уже пробовал:
<pre lang="c++">
void CStartPage::OnMouseMove(UINT nFlags, CPoint point) { ..... if() { <pre><pre>pDC->FillSolidRect(rect, clrTabSelected);
}
I create my own class where I derrived CBCGPStatic and write method code BOOL StaticStartpage::OnEraseBkgnd(CDC * pDC) { ASSERT_VALID(pDC); CRect rectClient; GetClientRect(rectClient); //pDC->FillRect(rectClient, clrTabSelected); CBrush brush(clrTabSelected); CBrush *pbrush = pDC->SelectObject(&brush); if (m_bHighlighted) { //pDC->FillSolidRect(rectClient, clrTabSelected); pDC->FillRect(rectClient, &brush); } return TRUE; } code , but it didn't help..
//UpdateWindow();
CBCGPDialog::OnMouseMove(nFlags, point);
}