即width,hight不起作用,重写了 COleControl 的 OnSetExtent在控件的初始化可以确定大小, 但不可以在对话框代码中动态改变大小。
对话框是通过类似代码加上去的:// m_dlg 是对话框对象void CMyCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
//pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
//pdc->Ellipse(rcBounds); m_dlg.MoveWindow(rcBounds, TRUE);
}
对话框是通过类似代码加上去的:// m_dlg 是对话框对象void CMyCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
//pdc->FillRect(rcBounds, CBrush::FromHandle((HBRUSH)GetStockObject(WHITE_BRUSH)));
//pdc->Ellipse(rcBounds); m_dlg.MoveWindow(rcBounds, TRUE);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货