CMFCCaptionButton Class
The CMFCCaptionButton class implements a button that is displayed on the caption bar for a docking pane or a mini-frame window. Typically, the framework creates caption buttons automatically.
class CMFCCaptionButton : public CObject
Members
Constructors
Name |
Description |
---|---|
Constructs a CMFCCaptionButton object. |
Public Methods
Name |
Description |
---|---|
Returns the command represented by the button. |
|
Returns the image ID associated with the button. |
|
Returns the rectangle occupied by the button. |
|
Returns the width and height of the button. |
|
Indicates whether the title bar height is set to mini size. |
|
Sets the button draw location and window show state. |
|
Draws the caption button. |
|
Sets the mini size of the title bar. |
Remarks
You can derive a class from CPaneFrameWnd Class and use the protected method, AddButton, to add caption buttons to a mini frame window.
CPaneFrameWnd.h defines command IDs for two types of caption buttons:
AFX_CAPTION_BTN_PIN, which displays a pin button when the docking pane supports auto-hide mode.
AFX_CAPTION_BTN_CLOSE, which displays a Close button when the pane can be closed or hidden.
Example
The following example demonstrates how to construct a CMFCCaptionButton object and set the mini size of the title bar.
CMFCCaptionButton* captionButton = new CMFCCaptionButton(AFX_HTCLOSE);
captionButton->SetMiniFrameButton(true);
Inheritance Hierarchy
Requirements
Header: afxcaptionbutton.h