突出显示MFC中的静态

突出显示MFC中的静态

本文介绍了突出显示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?





我尝试了什么:





What I have tried:

<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);

}



//UpdateWindow();
CBCGPDialog::OnMouseMove(nFlags, point);
}

推荐答案


这篇关于突出显示MFC中的静态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 11:18