在控件的构造函数中加上 m_bWindowOnly = True;
Flag indicating the control should be windowed, even if the container supports windowless controls.unsigned m_bWindowOnly:1; Remarks Note To use this data member within your control class, you must declare it as a data member in your control class. Your control class will not inherit this data member from the base class because it is declared within a union in the base class. See Also CComControlBase Overview | Class Members | CComControlBase::m_bWndLess