ToolBarButton
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Represents an item in the ToolBar.
- C#
- VB.NET
public class ToolBarButton : BindableComponent, ICommandSource
Public Class ToolBarButton
Inherits BindableComponent
Implements ICommandSource
Change the type of item to display using the Style property.
Constructors
ToolBarButton()
Initializes a new instance of the ToolBarButton class.
ToolBarButton(text)
Initializes a new instance of the ToolBarButton class and displays the assigned text on the button.
| Name | Type | Description |
|---|---|---|
| text | String | The text to display on the new ToolBarButton. |
Properties
AllowHtml
Boolean: Returns or sets a value indicating that the control can display HTML in the Text property. (Default: False)
AppearanceKey
String: Sets the appearance key for the theme engine. (Default: null)
AutoShowLoader
Boolean: Returns or sets whether the application blocks the browser with a modal mask when this button is clicked and until the server is done processing the execution request. (Default: False)
Value: true to automatically show the ajax loader; otherwise, false. The default is false.
AutoShowLoader blocks the entire browser as soon as the button is clicked since it's implemented on the client side, while ShowLoader blocks the specific widget when returning from the request.
Command
ICommand: Returns or sets the ICommand implementation to invoke. (Default: null)
DropDownMenu
ContextMenu: Returns or sets the menu to be displayed in the drop-down toolbar button. (Default: null)
Value: A ContextMenu to be displayed in the drop-down toolbar button. The default is null.
Enabled
Boolean: Returns or sets whether the button is enabled. (Default: True)
Value: True if the button is enabled; otherwise, false. The default is true.
ForeColor
Color: Returns or sets the text color of the toolbar button.
Image
Image: Returns or sets the image that is displayed in a ToolBarButton.
Value: The Image displayed on the button control. The default value is null.
ImageIndex
Int32: Returns or sets the index value of the image assigned to the ToolBarButton. (Default: -1)
Value: The index value of the Image assigned to the toolbar button. The default is -1.
Throws:
- ArgumentOutOfRangeException The specified index is less than -1.
ImageKey
String: Returns or sets the name of the image assigned to the button. (Default: "")
Value: The name of the Image assigned to the ToolBarButton.
ImageSource
String: Returns or sets the theme name or URL for the image to display in the ToolBarButton.
Value: The theme name or URL for the image to display in the button control.
Margin
Padding: Returns or sets the space between toolbar buttons.
Name
String: Returns or sets the name of the ToolBarButton.
Value: The name of the ToolBarButton.
Padding
Padding: Returns or sets padding within the toolbar button.
Parent
ToolBar: Returns the toolbar control that the toolbar button is assigned to.
Value: The ToolBar control that the ToolBarButton is assigned to.
Pushed
Boolean: Returns or sets whether a toggle-style toolbar button is currently in the pushed state. (Default: False)
Value: true if a toggle-style toolbar button is currently in the pushed state; otherwise, false. The default is false.
SizeMode
ToolBarButtonSizeMode: Returns or sets how the toolbar button is resized. (Default: Auto)
Value: One of the ToolBarButtonSizeMode values. The default is Auto.
Style
ToolBarButtonStyle: Returns or sets the style of the toolbar button. (Default: PushButton)
Value: One of the ToolBarButtonStyle values. The default is ToolBarButtonStyle.PushButton.
Tag
Object: Returns or sets the object that contains data about the toolbar button. (Default: null)
Value: An Object that contains data about the toolbar button. The default is null.
Text
String: Returns or sets the text displayed on the toolbar button. (Default: "")
Value: The text displayed on the toolbar button. The default is an empty string ("").
When AllowHtml is set to true, the text can contain HTML content. If the text contains new lines (CRLF) but doesn't contain HTML elements (at least one "<") all CRLF are automatically substituted with "<br/>".
ToolTipText
String: Returns or sets the text that appears as a ToolTip for the button. (Default: "")
Value: The text that is displayed when the mouse pointer moves over the toolbar button. The default is an empty string ("").
Visible
Boolean: Returns or sets whether the toolbar button is visible or hidden. (Default: True)
Value: true if the toolbar button is visible; otherwise, false. The default is true.
Methods
Dispose(disposing)
Releases the resources used by the ToolBarButton.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
OnAddReferences(items)
Returns a collection of referenced components or collection of components.
| Parameter | Type | Description |
|---|---|---|
| items | IList |
OnClick(e)
Fires the Click event.
OnCommandChanged(e)
Fires the CommandChanged event.
OnPushedChanged(e)
Fires the PushedChanged event.
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
PerformClick()
Generates the Click and ButtonClick events.
Update()
Updates the component on the client. Overridden to repaint the toolbar in design mode.
ValidateActiveControl()
Validates the current control.
Returns: Boolean. true if the active control is validated.
Events
Click
EventHandler Fired when the control is clicked.
CommandChanged
EventHandler Fired when the Command property value changes.
PushedChanged
EventHandler Fired when the Pushed property value changes.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| ICommandSource | Defines an object that can invoke a Command. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |