BCGControlBar Library for .NET
ToolbarButton Class Members
Fields  Properties  Methods  Events


The following tables list the members exposed by ToolbarButton.

Public Constructors
 NameDescription
Public ConstructorToolbarButton ConstructorOverloaded.   
Top
Public Fields
 NameDescription
Public Fieldm_handlersRepresents a collection of event handlers of the toolbar button. As usual, this collection contains an ExecuteCommand event handler and UpdateCommandUI event handlers. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Top
Protected Fields
Public Properties
 NameDescription
Public PropertyArrowRect  
Public PropertyAutoRepeatEnabledSpecifies if the timer for execution of autorepeat commands is enabled. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyBasicCommandSet to false in order to hide this button in MRU mode (most recent used commands mode). You can set MenuBar::ShowAllCommands property to control this mode.  
Public PropertyBoundsSpecifies the boundaries of the command object. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyButtonMode  
Public PropertyCanAddToCustomizeListIndicates a value whether button can be added to customize list in Ribbon application.  
Public PropertyCanBeSeparated  
Public PropertyCanExecuteDefaultCommand  
Public PropertyCanResize  
Public PropertyCanShowPopupMenuTells whether the toolbar button can show a popup menu.  
Public PropertyCanStretchApplied to combo box and edit box buttons, which placed on toolbars in StandAlone (non-dockable) mode. If true, the button will be automatically resized to take the rest of toolbar space. Can be only one button per toolbar.  
Public PropertyCanUpdateCommandUIIf true, button fires UpdateCommandUI event at idle time. Keep this property false unless you subscribe to UpdateCommandUI for this button.  
Public PropertyCheckableSpecifies if the command object can get a check state. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyCheckedGets or sets a value indicating whether the command object is in the checked state. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyClickArrow  
Public PropertyCloseBackstageOnClick  
Public PropertyClosePopupMenuOnClick  
Public PropertyCmdBarManager  
Public PropertyColdImageSpecifies a cold image for the button.  
Public PropertyCollapseStateSpecifies the collapsed state of the ToolbarButton on the Ribbon control.  
Public PropertyCommandDescriptionCommand description appears in Description area on Customize dialog.")>  
Public PropertyCommandEntry  
Public PropertyCommandIndexInCommandList  
Public PropertyCommandNameSpecifies unique text identifier of command. Designer will create event handlers using this text.  
Public PropertyCommandTextCommand Text appears in Customize dialog.  
Public PropertyContainer (Inherited from System.ComponentModel.Component)
Public PropertyCustomImage  
Public PropertyCustomLayoutSpecifies if the size and location of the command object is defined by user and this object will not be resized and moved on calling function AdjustLayout of the parent command panel. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyDesignMode  
Public PropertyDisabledImageSpecifies button default image. The image is stored in the underlined command. If you change this property, all buttons with the same ID/CommandName will display this image. By default the library generates this image from HiColorImage.  
Public PropertyDisabledLargeImageSpecifies button disabled small image. The image is stored in the underlined command. If you change this property, all buttons with the same ID/CommandName will display this image. By default the library generates this image from LargeImage.  
Public PropertyDisabledMenuImageSpecifies the image to draw on the toolbar button in the disabled state.  
Public PropertyDisplayedImageRect  
Public PropertyDisplayHDPIImageTells whether the button currently displays HDPI or regular images.  
Public PropertyDisplayImage  
Public PropertyDrawDefaultImageOnCustomizeList  
Public PropertyEditable  
Public PropertyEnabledOverridden.   
Public PropertyExclusive  
Public PropertyExplicitDisposeThis property has no default implementation. Override this property in the derived class to specify if the command object should be destroy on removing the parent command panel. In BCGControlBar.NET library this property is used in destructor of the PopupMenuBar class to specify if  its child menu items should be removed. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyFadedImage  
Public PropertyFirstInGroup  
Public PropertyGroupSpecifies Category name in Customize dialog. The button will appear under this Category.  
Public PropertyHashedCommand  
Public PropertyHDPIColdImageSpecifies a cold image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHDPIDisabledImageSpecifies a disabled image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHDPIDisabledLargeImageSpecifies a disabled large image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHDPIDisabledMenuImageSpecifies a disabled menu image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHDPIHiColorImageSpecifies an high color image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHdpiImageModeSpecifies how this button treats HDPI images (HDPIColdImage, HDPIDisabledImage and other properties).
Set this property to HDPIImageMode.Inherit to inherit this setting from CommandBarManager.DisplayHDPIImages.
Set this property to HDPIImageMode.HDPI to always display HDPI images.
Set this property to HDPIImageMode.Normal to always display regular images.

If HDPI image(s) is not specified, the library always falls back to appropriate regular images.  
Public PropertyHDPILargeImageSpecifies a large image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHDPIMenuImageSpecifies a menu image to be used in HDPI mode. The HDPIImageMode property should be set to HDPIImageMode.Inherit or HDPIImageMode.HDPI to make this image shown when you decide that application should use special HDPI images.  
Public PropertyHiColorImageSpecifies button default image. The image is stored in the underlined command. If you change this property, all buttons with the same ID/CommandName will display this image.  
Public PropertyHidden (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyHighlightedIndicates a value if the command object is highlighted. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyHorzOnly  
Public PropertyHostCommandBar  
Public PropertyIDOverridden. Unique command identifier this button is related to. This value is assigned automatically by the library. However, you can set it manually to quickly assign the button to another command.  
Public PropertyIgnoreImageArea  
Public PropertyIgnoreLargeIconsModeOverridden.   
Public PropertyInternalImageIDSpecifies the image from IMAGE_IDS collection to draw within the button. In default implementation of the constructor of the CommandButton class the value "Undefined" is set. (Inherited from BCGSoft.Controls.Shared.CommandButton)
Public PropertyIsCommand  
Public PropertyIsDialogControlSpecifies if the command object should be redrawn as a dialog control. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyIsHorizontalOverridden.   
Public PropertyIsItemListUsable only for menu buttons. If you set this property to true, the button will be treated as a single entity in Customize mode, but expanded into list of menu items at runtime. For example, this property should be true for Windows List menu item.  
Public PropertyIsSeparatorOverridden. Set to true in order to turn this button into a separator.  
Public PropertyIsWindowPositionMenuUsable only for menu buttons. Set to true in conjunction with IsItemList property. The button will be automatically expanded into Floating, Dockable, Tabbed Document, Auto Hide, Hide menu item list.  
Public PropertyKeyTipSpecifies an unique in the current context combination of one or two letters for the keyboard navigation to the given command.  
Public PropertyKeyTipSplit

Specifies an unique in the current context combination of one or two letters for the keyboard navigation to the given command.

KeyTipSplit is used for split menu buttons only/ It's diplayed in the right part of menu button and opens a popup menu.

 
Public PropertyLargeIconArea  
Public PropertyLargeIconsDelimiterModeSpecifies the mode of toolbar button in LargeIconMode and Smart mode  
Public PropertyLargeImageSpecifies button large image. The image is stored in the underlined command. If you change this property, all buttons with the same ID/CommandName will display this image.")>  
Public PropertyLargeImageModeButton displays large image (usable for smart layout).")>  
Public PropertyLastInGroup  
Public PropertyLocation

Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its parent command panel.

(Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyLocked  
Public PropertyLowColorImage  
Public PropertyMarginOverridden.   
Public PropertyMaxAllowedCollapseStateSpecifies the maximum collapsed state which can get a button.  
Public PropertyMenuImageSpecifies button default menu image. Set this property only if menu and toolbar image should have different sizes.  
Public PropertyMessageStringText to be shown on Status Bar.  
Public PropertyMinAllowedCollapseState  
Public PropertyOffset  
Public PropertyParentButton  
Public PropertyParentCommandBarA reference to a command bar, which hosts the toolbar button.  
Public PropertyParentPath  
Public PropertyPopup  
Public PropertyPopupMenuBar  
Public PropertyPressedGets a value indicating whether the state of the CommandObject is pressed. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyQuickCustomizeMode  
Public PropertyQuickCustomizeToolbar  
Public PropertyRarelyUsed  
Public PropertyRelatedForms  
Public PropertyReplaceDefaultCommandIf the button is marked as 'CanExecuteDefaultCommand' its command entry can be replaced by last executed command. This flag controls whether the default command stays the same, or not.")>  
Public PropertySelected  
Public PropertySerializeItemList  
Public PropertyShadowImage  
Public PropertyShortcutsCollectionEdit to assign shortcuts to commands.  
Public PropertyShowImageOverridden. Indicates a value whether the image should be displayed on the ToolbarButton.  
Public PropertyShowMenuOnMouseMove  
Public PropertyShowTextOverridden. Indicates a value whether the text should be displayed on the ToolbarButton.  
Public PropertyShowTooltipAlways  
Public PropertySite (Inherited from System.ComponentModel.Component)
Public PropertySmartMode  
Public PropertyTextOverridden. Specifies button text. It can be different text for buttons assigned to one command. This property can be changed by user at runtime during customization.  
Public PropertyTextAlignment  
Public PropertyTextImagePositionSpecifies the position of the image relative to text displayed on the command button. (Inherited from BCGSoft.Controls.Shared.CommandButton)
Public PropertyToolTipTextButton's tooltip text.  
Public PropertyTransparentColorTransparent color of button images.  
Public PropertyUserData  
Public PropertyVisibleGets or sets a value indicating whether the command object is displayed. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public PropertyVisibleOnQuickCustomizeMenu  
Public PropertyVisualStateSpecifies how button's image and text  are displayed when button is located on the toolbar, the  menu bar,  the popup menu bar and  the popup palette. Reflects to the state displayed in customize mode. (Inherited from BCGSoft.Controls.Shared.CommandButton)
Public PropertyVisualStyleOverridden.   
Public PropertyWidthOverridden.   
Public PropertyWrapOverridden.   
Top
Protected Properties
Public Methods
 NameDescription
Public MethodAddShortcutCalled by the framework to associate any shortcut with this ToolbarButton.  
Public MethodButtonFromIDCalled by framework to get any toolbar button by its identifier. If the identifier of this button is equal to the identifier from parameter, the current button will be returned, otherwise, null reference.  
Public MethodCanDropIndicates a value whether the button can be dropped to the specified toolbar.  
Public MethodCanGetFocusGets a value indicating whether the toolbar button can receive a focus.  
Public MethodChangeExecuteCommandHandler  
Public MethodClearSelectionStateOverride this function in the derived class to deselect this button and buttons located on its child popup menu.  
Public MethodCloneCreates a new object that is a copy of the current ToolBarButton object.  
Public MethodContainsPointIndicates a value whether the specified point is located within the boundaries on this toolbar button.  
Public MethodCopyBaseHandlers (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodCopyFromCopies properties from the specified ToolBarButton to this button.  
Public MethodCopyHandlersOverloaded. Copies event handlers from the specified ToolBarButton to this button.  
Public MethodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from System.MarshalByRefObject)
Public MethodDisposeOverloaded. Overridden.   
Public MethodDrawButtonImageCalled by the framework to draw an image on the button surface.  
Public MethodFillInteriorFills the interior of the specified rectangle on button surface.  
Public MethodFire_ExecuteCommandRaises an ExecuteCommand event.  
Public MethodFire_PropertyChangedRaises PropertyChanged event  which occurs when a property value changes. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodGetDataOverloaded. 

Creates a shallow copy of the current ToolBarButton if the specified name of the type is  ToolBarButton, otherwise, a null reference.

 
Public MethodGetDataPresentOverloaded. 

Determines whether  this object has a  type of the name "ToolBarButton".

 
Public MethodGetDefaultSize

Returns the default size of the button. The width of the button is equal to the column width of the toolbar and height depends on the location of the button image. Called by the framework to calculate the size of the button.

 
Public MethodGetFirstShortcutReturns the first shortcut object  from the user shortcuts' collection of the related CommandEntry.  Called by the framework on drawing the shortcut on the tooltips and on the menu items.  
Public MethodGetFormatsOverloaded. Gets a list of all formats that data stored in this instance is associated with or can be converted to, using a Boolean value to determine whether to retrieve all formats that the data can be converted to or only native data formats. Returns null reference.  
Public MethodGetKeyTipRect  
Public MethodGetKeyTipRectSplit  
Public MethodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public MethodGetObjectDataGets serialization information with all of the data needed to recreate an instance of this ToolBarButton.  
Public MethodGetServiceOverridden. Gets the service object of the specified type, if it is available.  
Public MethodGetSubItems (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodGetTextSizeOverloaded. Called by the framework to calculate the  size, in pixels, of the text  to draw on the ToolBarButton.  
Public MethodHasExecuteHandler  
Public MethodInitComplete (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from System.MarshalByRefObject)
Public MethodIsCustomizeModeSpecifies if the ToolBarButton is in the customize mode. The ToolBarButton has a customize mode if it has a parent command bar which is in the customize mode.  
Public MethodIsDesignModeRetrieves a value that indicates whether the toolbar is currently using the Microsoft Visual Studio .NET Editor  
Public MethodIsDrawTextSpecifies if the text should be drawn on the button surface. It should be drawn if the toolbar button is located on the popupmenu bar or the value of the property ShowText is true.  
Public MethodIsDroppedDownSpecifies if the button has a submenu and this submenu is currently displayed.  
Public MethodIsInsideResizeAreaDetermines if the specified point is located inside the area which allows to resize a toolbar.  
Public MethodIsItemCollectionVisibleIn default implementation the function returns false. You  can override this function in the derived class to indicate a value if the command object has a popup menu items' collection and this items are visible.  In BCGControlBar.NET library this function is overridden in class ToolBarMenuButton to specify the visibility of the related popup menu. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodIsQuickCustomizeButtonSpecifies if this ToolBarButton is a button of the type QuickCustomizeButton. By default, the returned value is false. In BCGSoft.Controlbar namespace this function is overridden in class QuickCustomizeButton to return true.  
Public MethodIsSyncSource  
Public MethodObjCheckedGets a value indicating whether the ToolBarButton is in the checked state.  
Public MethodObjCommandIDReturns the command identifier of the ToolbarButton.  
Public MethodObjEnabledGets a value indicating whether the button is enabled.  
Public MethodObjTextGets  the text displayed on the toolbar button.  
Public MethodOnCalculateSizeOverridden. Calculates the size of the toolbar button according to its default size and content.  
Public MethodOnCancelModeOverride this function to cancel the current state of the button.  
Public MethodOnCommandButtonExecuteCommandRaises ExecuteCommand event, which occurs when the user clicks the toolbar button. Executes a set of commands related to this command button.  
Public MethodOnDrawOverridden. This function performs the actual drawing of the toolbar button  
Public MethodOnDrawCustomizeSelectionDraws a rectangle border at the toolbar button in Customize mode.  
Public MethodOnDrawDesignRedraws the button in design mode.  
Public MethodOnDrawInteriorDraws image, text, boundaries, highligting, etc. on the surface of the ToolbarButton.  
Public MethodOnDrawOnCustomizeListOverloaded. Called by the framework to draw the toolbar button in commands' list of the customize dialog box.  
Public MethodOnDropOnPopupMenuSpecifies a ToolbarMenuButton which popup menu was opened.  
Public MethodOnExecuteCommandRaises ExecuteCommand event, which occurs when the user clicks the toolbar button.  
Public MethodOnMouseDownOverridden. Override this function in the derived class to raise the MouseDown event,  which occurs when the mouse pointer is over the toolbar button and a mouse button is pressed.  
Public MethodOnMouseMoveOverride this function in the derived class to raise the MouseMove event, which occurs when the mouse pointer is moved over the toolbar button.  
Public MethodOnMouseUpOverridden. Override this function in the derived class to raise the MouseUp event, which occurs when the mouse pointer is over the toolbar button and a mouse button is released.  
Public MethodOnSmartCalcSizeCalculates the size of  the ToolBarButton accroding the specified ToolbarButtonCollapseState  
Public Methodraise_DrawCommandObject (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public Methodraise_ExecuteCommandRaises ExecuteCommand event, which occurs when the user clicks the toolbar button.  
Public Methodraise_ParentCommandBarChanged  
Public Methodraise_ParentCommandBarChanging  
Public Methodraise_PropertyChanged (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public Methodraise_RedrawCommandObject (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public Methodraise_UpdateCommandUIRaises UpdateCommandUI event, that forces a refresh of the command UI state.  
Public MethodRaise_UpdateCommandUIRaises UpdateCommandUI event, that forces a refresh of the command UI state.  
Public Methodraise_WidthChanging  
Public MethodRecreate
Recreates the command bar from the specified ToolbarButton using serialization info.
 
Public MethodRedrawOverridden. Redraws an area on the parent command bar which equals to  the boundaries of the toolbar button.  
Public MethodRemoveExecuteCommandHandlerRemoves an ExecuteCommand event handler from the toolbar button in design mode.  
Public MethodResetTextSize  
Public MethodSetCursor

Sets the current application's cursor to the specified point.

 
Public MethodSetCustomImageSets a specified custom image to the toolbar button. In BCGSoft.ControlBars namespace  this function is called by the framework on creating a copy of the button.  
Public MethodSetDataOverloaded.   
Public MethodSetNextCollapsedStateSets the nearest collapsed state of the ToolbarButton located on the Ribbon Control.  
Public MethodSetRectangleOverloaded. Sets the boundaries of the toolbar button.  
Public MethodShouldSerializeCmdBarManagerSpecifies if the command bar manager associated with the parent toolbar should be serialized.  
Public MethodShouldSerializeColdImageSpecifies if the cold image associated with the button should be serialized.  
Public MethodShouldSerializeCustomImageSpecifies if the custom image associated with the button should be serialized.  
Public MethodShouldSerializeDisabledImageSpecifies if the disabled image associated with the button should be serialized.  
Public MethodShouldSerializeDisabledLargeImage  
Public MethodShouldSerializeDisabledMenuImageSpecifies if the disabled menu image associated with the button should be serialized.  
Public MethodShouldSerializeHDPIColdImage  
Public MethodShouldSerializeHDPIDisabledImage  
Public MethodShouldSerializeHDPIDisabledLargeImage  
Public MethodShouldSerializeHDPIDisabledMenuImage  
Public MethodShouldSerializeHDPIHiColorImage  
Public MethodShouldSerializeHDPILargeImage  
Public MethodShouldSerializeHDPIMenuImage  
Public MethodShouldSerializeHiColorImageSpecifies if the high color image associated with the button should be serialized.  
Public MethodShouldSerializeIDSpecifies if the identifier associated with the button should be serialized.  
Public MethodShouldSerializeKeyTip  
Public MethodShouldSerializeKeyTipSplit  
Public MethodShouldSerializeLargeIconArea  
Public MethodShouldSerializeLargeIconsDelimiterMode  
Public MethodShouldSerializeLargeImage  
Public MethodShouldSerializeLowColorImageSpecifies if the low color image associated with the button should be serialized.  
Public MethodShouldSerializeMenuImageSpecifies if the menu image associated with the button should be serialized.  
Public MethodShouldSerializeQuickCustomizeToolbarSpecifies if the quick customize toolbar associated with the button should be serialized.  
Public MethodShouldSerializeSelectedSpecifies if the selection associated with the button should be serialized.  
Public MethodShouldSerializeVisualStyleSpecifies if the visual style of the button should be serialized.  
Public MethodSyncronizeWithSpecifies that it is necessary to synchronize the state of any ISupportCmdUI object.  
Public MethodToStringReturns the parent path and command name of the command button.  
Public MethodUpdateCheckedCalled by the framework to update the check state of the toolbar button using ISupportCmdUI interface.  
Public MethodUpdateEnabledCalled by the framework to update the enabled state of the toolbar button using ISupportCmdUI interface.  
Public MethodUpdateParentPanelRedraws a part of the parent panel. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public MethodUpdateTextCalled by the framework to update the text of the toolbar button using ISupportCmdUI interface.  
Public MethodValidateCommandNameCalled by the framework on setting command name by user. Makes this command name corresponding the rules.  
Top
Protected Methods
Public Events
 NameDescription
Public EventDisposed (Inherited from System.ComponentModel.Component)
Public EventDrawCommandObjectOccurs on redrawing of the command object. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public EventExecuteCommandOccurs when the user clicks the toolbar button.  
Public EventParentCommandBarChangedOccurs when the parent command bar is changed.  
Public EventParentCommandBarChangingOccurs when the parent command bar is about to change.  
Public EventPropertyChangedOccurs when a property value changes. (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public EventRedrawCommandObject (Inherited from BCGSoft.Controls.Shared.CommandObject)
Public EventUpdateCommandUIOccurs when the current command UI state is refreshed.  
Public EventWidthChangingOccurs when the width of the toolbar button is about to change.  
Top
See Also

Reference

ToolbarButton Class
BCGSoft.ControlBars Namespace

Send Feedback