First, we need to set the initial size of the control to its static size using the COleControl::SetInitialSize method. This should be done in your control's constructor like this://////////////////////////////////////////////// // CFAQCtrl::CFAQCtrl - Constructor CFAQCtrl::CFAQCtrl() { InitializeIIDs(&IID_DFAQ, &IID_DFAQEvents); SetInitialSize( 28, 28 ); }override OnSetExtent and return FALSE, which tells the container that the control cannot be re-sized BOOL CFAQCtrl::OnSetExtent( LPSIZEL lpSizeL ) { return FALSE; } for more refer to http://www.widgetware.com/FAQArticle.htm#Size
剩下的你看结构吧。够用了。
// CFAQCtrl::CFAQCtrl - Constructor
CFAQCtrl::CFAQCtrl()
{
InitializeIIDs(&IID_DFAQ, &IID_DFAQEvents);
SetInitialSize( 28, 28 );
}override OnSetExtent and return FALSE, which tells the container that the control cannot be re-sized
BOOL CFAQCtrl::OnSetExtent( LPSIZEL lpSizeL )
{
return FALSE;
}
for more refer to
http://www.widgetware.com/FAQArticle.htm#Size