Compartilhar via


CMFCToolBarEditBoxButton Class

A toolbar button that contains an edit control (CEdit Class).

class CMFCToolBarEditBoxButton : public CMFCToolBarButton

Members

Public Constructors

Name

Description

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton

Constructs a CMFCToolBarEditBoxButton object.

CMFCToolBarEditBoxButton::~CMFCToolBarEditBoxButton

Destructor.

Public Methods

Name

Description

CMFCToolBarEditBoxButton::CanBeStretched

Specifies whether a user can stretch the button during customization. (Overrides CMFCToolBarButton::CanBeStretched.)

CMFCToolBarEditBoxButton::CopyFrom

Copies the properties of another toolbar button to the current button. (Overrides CMFCToolBarButton::CopyFrom.)

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton::CreateEdit

Creates a new edit control in the button.

CMFCToolBarEditBoxButton::CreateObject

Used by the framework to create a dynamic instance of this class type.

CMFCToolBarEditBoxButton::GetByCmd

Retrieves the first CMFCToolBarEditBoxButton object in the application that has the specified command ID.

CMFCToolBarEditBoxButton::GetContentsAll

Retrieves the text of the first edit box toolbar control that has the specified command ID.

CMFCToolBarEditBoxButton::GetContextMenuID

Retrieves the resource ID of the shortcut menu that is associated with the button.

CMFCToolBarEditBoxButton::GetEditBorder

Retrieves the bounding rectangle of the edit part of the edit box button.

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton::GetEditBox

Returns a pointer to the edit control that is embedded in the button.

CMFCToolBarEditBoxButton::GetHwnd

Retrieves the window handle that is associated with the toolbar button. (Overrides CMFCToolBarButton::GetHwnd.)

CMFCToolBarEditBoxButton::GetInvalidateRect

Retrieves the region of the client area of the button that must be redrawn. (Overrides CMFCToolBarButton::GetInvalidateRect.)

CMFCToolBarEditBoxButton::GetThisClass

Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

CMFCToolBarEditBoxButton::HaveHotBorder

Determines whether a border of the button is displayed when a user clicks the button. (Overrides CMFCToolBarButton::HaveHotBorder.)

CMFCToolBarEditBoxButton::IsFlatMode

Determines whether edit box buttons have a flat style.

CMFCToolBarEditBoxButton::NotifyCommand

Specifies whether the button processes the WM_COMMAND message. (Overrides CMFCToolBarButton::NotifyCommand.)

CMFCToolBarEditBoxButton::OnAddToCustomizePage

Called by the framework when the button is added to a Customize dialog box. (Overrides CMFCToolBarButton::OnAddToCustomizePage.)

CMFCToolBarEditBoxButton::OnCalculateSize

Called by the framework to calculate the size of the button for the specified device context and docking state. (Overrides CMFCToolBarButton::OnCalculateSize.)

CMFCToolBarEditBoxButton::OnChangeParentWnd

Called by the framework when the button is inserted into a new toolbar. (Overrides CMFCToolBarButton::OnChangeParentWnd.)

CMFCToolBarEditBoxButton::OnClick

Called by the framework when the user clicks the mouse button. (Overrides CMFCToolBarButton::OnClick.)

CMFCToolBarEditBoxButton::OnCtlColor

Called by the framework when the parent toolbar handles a WM_CTLCOLOR message. (Overrides CMFCToolBarButton::OnCtlColor.)

CMFCToolBarEditBoxButton::OnDraw

Called by the framework to draw the button by using the specified styles and options. (Overrides CMFCToolBarButton::OnDraw.)

CMFCToolBarEditBoxButton::OnDrawOnCustomizeList

Called by the framework to draw the button in the Commands pane of the Customize dialog box. (Overrides CMFCToolBarButton::OnDrawOnCustomizeList.)

CMFCToolBarEditBoxButton::OnGlobalFontsChanged

Called by the framework when the global font has changed. (Overrides CMFCToolBarButton::OnGlobalFontsChanged.)

CMFCToolBarEditBoxButton::OnMove

Called by the framework when the parent toolbar moves. (Overrides CMFCToolBarButton::OnMove.)

CMFCToolBarEditBoxButton::OnShow

Called by the framework when the button becomes visible or invisible. (Overrides CMFCToolBarButton::OnShow.)

CMFCToolBarEditBoxButton::OnSize

Called by the framework when the parent toolbar changes its size or position and this change causes the button to change size. (Overrides CMFCToolBarButton::OnSize.)

CMFCToolBarEditBoxButton::OnUpdateToolTip

Called by the framework when the parent toolbar updates its tooltip text. (Overrides CMFCToolBarButton::OnUpdateToolTip.)

CMFCToolBarEditBoxButton::Serialize

Reads this object from an archive or writes it to an archive. (Overrides CMFCToolBarButton::Serialize.)

CMFCToolBarEditBoxButton::SetACCData

Populates the provided CAccessibilityData object with accessibility data from the toolbar button. (Overrides CMFCToolBarButton::SetACCData.)

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton::SetContents

Sets the text in the edit control of the button.

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton::SetContentsAll

Finds the edit control button that has a specified command ID, and sets the text in the edit control of that button.

CMFCToolBarEditBoxButton::SetContextMenuID

Specifies the resource ID of the shortcut menu that is associated with the button.

CMFCToolBarEditBoxButton::SetFlatMode

Specifies the flat style appearance of edit box buttons in the application.

CMFCToolBarEditBoxButton::CMFCToolBarEditBoxButton::SetStyle

Specifies the style of the button. (Overrides CMFCToolBarButton::SetStyle.)

Remarks

To add an edit box button to a toolbar, follow these steps:

1. Reserve a dummy resource ID for the button in the parent toolbar resource.

2. Construct a CMFCToolBarEditBoxButton object.

3. In the message handler that processes the AFX_WM_RESETTOOLBAR message, replace the dummy button with the new combo box button by using CMFCToolBar::ReplaceButton.

For more information, see Walkthrough: Putting Controls On Toolbars.

Example

The following example demonstrates how to use various methods in the CMFCToolBarEditBoxButton class. The example shows how to specify that a user can stretch the button during customization, specify that a border of the button is displayed when a user clicks the button, set the text in the text box control, specify the flat style appearance of edit box buttons in the application, and specify the style of a toolbar edit box control.

  CMFCToolBarEditBoxButton* boxButton = new CMFCToolBarEditBoxButton();
    boxButton->CanBeStretched();
    boxButton->HaveHotBorder();
    boxButton->SetContents(_T("edit box button"));
    boxButton->SetFlatMode(true);
    boxButton->SetStyle(TBBS_PRESSED);

Inheritance Hierarchy

CObject

   CMFCToolBarButton

      CMFCToolBarEditBoxButton

Requirements

Header: afxtoolbareditboxbutton.h

See Also

Tasks

Walkthrough: Putting Controls On Toolbars

Reference

Hierarchy Chart

CMFCToolBarButton Class

CEdit Class

CMFCToolBar::ReplaceButton

Other Resources

MFC Classes