SAMPLE: ColorFrm Demonstrates ActiveX Control with Popup ToolbarID: Q166193
|
The ColorFrm sample demonstrates adding a popup toolbar to an ActiveX
Control. ColorFrm uses a CMiniFrameWnd derived class to contain the toolbar
that is visible whenever the control is UI Active. When the control is no
longer active, the toolbar is hidden and its position is saved.
The ColorFrm sample details which COleControl functions must be overridden
to achieve this behavior. The sample also demonstrates some other basic
ActiveX Control functionality, such as an OnDraw function that renders
differently based on the AmbientUserMode of the control.
The following file is available for download from the Microsoft Software
Library:
ColorFrm.exeFor more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services
It is often useful to add a popup toolbar to an ActiveX Control that can be
used to provide a user interface to the control. In most cases, you do not
want the toolbar to be visible if the control is not UI Active because
there may be other controls on the dialog or form. The ColorFrm sample
demonstrates how to add a CMiniFrameWnd class and toolbar to an ActiveX
Control.
The steps listed below outline the process used to create a popup toolbar
that hides itself when its parent control is not UI Active:
- OnShowToolBars()
- OnHideToolBars()
Additional query words:
Keywords : kbfile kbole kbsample kbMFC kbVC400 kbVC410 kbVC420 kbVC500 kbVC600
Version : WINNT:4.0,4.0a,4.1,4.2,4.2b,5.0,6.0
Platform : NT WINDOWS
Issue type :
Last Reviewed: August 8, 1999