在运行的时候隐藏,在设计的时候,在frame上显示一个图标,而且这个控件大小不能拖动,只能是那个图标的大小,如何做呢?

解决方案 »

  1.   

    如用MFC做,则每次处理WM_SIZE时设定回原来的大小;ATL做也类似
      

  2.   

    ON_WM_GETMINMAXINFO()
    剩下的你看结构吧。够用了。
      

  3.   

    mfc 在你的控件的构造函数里用SetInitialSize
      

  4.   

    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