16,472
社区成员
发帖
与我相关
我的任务
分享
void CActiveX_3Ctrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
pdc->SetTextColor(Colors[m_exForeColor]/*RGB(255,0,0)*/);
pdc->SetBkMode(TRANSPARENT);
//这里我也改变了控件矩形区,为什么运行时控件大小没有变化???而且我想矩形区向右下偏移为什么不可以???
pdc->Rectangle((rcBounds+m_rcRect));
CBrush brush(Colors[m_exBackColor]/*RGB(0,0,255)*/);
pdc->FillRect(rcBounds, &brush);
CRect rect(rcBounds+m_rcRect);
pdc->DrawText(_T("查看场景"), &rect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
}
void CActiveX_3Ctrl::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_rcRect.left = -10;
m_rcRect.top = -10;
m_rcRect.right = 10;
m_rcRect.bottom = 10;
InvalidateControl();
COleControl::OnLButtonDown(nFlags, point);
}
void CActiveX_3Ctrl::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_rcRect.left = 10;
m_rcRect.top = 10;
m_rcRect.right = -10;
m_rcRect.bottom = -10;
InvalidateControl();
COleControl::OnLButtonUp(nFlags, point);
}
void CActiveX_3Ctrl::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_rcRect.left = -10;
m_rcRect.top = -10;
m_rcRect.right = 10;
m_rcRect.bottom = 10;
InvalidateControl();
COleControl::OnLButtonDown(nFlags, point);
}
void CActiveX_3Ctrl::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
m_rcRect.left = 10;
m_rcRect.top = 10;
m_rcRect.right = -10;
m_rcRect.bottom = -10;
InvalidateControl();
COleControl::OnLButtonUp(nFlags, point);
}