Button
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Represents a button control.
- C#
- VB.NET
public class Button : ButtonBase, IButtonControl
Public Class Button
Inherits ButtonBase
Implements IButtonControl
Constructors
Button()
Initializes a new instance of the Button class.
Button(text, onClick)
Initializes a new instance of the Button class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| text | String | Initial text. |
| onClick | Action<Object, EventArgs> | Optional Click handler. |
Button(text, location, size, onClick)
Initializes a new instance of the Button class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| text | String | Initial text. |
| location | Point | Initial location. |
| size | Size | Initial size. |
| onClick | Action<Object, EventArgs> | Optional click handler. |
Button(text, ImageSource, location, size, onClick)
Initializes a new instance of the Button class with specific initial settings.
| Name | Type | Description |
|---|---|---|
| text | String | Initial text. |
| ImageSource | String | Image source. |
| location | Point | Initial location. |
| size | Size | Initial size. |
| onClick | Action<Object, EventArgs> | Optional click handler. |
Properties
AutoSizeMode
AutoSizeMode: Returns or sets the mode by which the Button automatically resizes itself. (Default: GrowOnly)
Value: One of the AutoSizeMode values. The default value is GrowOnly.
AutoToolTip
Boolean: Returns or sets whether a tooltip is displayed when the text extends beyond the size of the control. (Default: False)
Value: true to show the tooltip; otherwise, false. The default is false.
The auto tooltip is set on the browser using the title attribute managed by the browser, does not use the themed tooltip managed by Wisej.NET.
BorderStyle
BorderStyle: Returns or sets the border style of the button control. (Default: Solid)
Value: A BorderStyle that represents the border type of the button control. The default is Solid.
DialogResult
DialogResult: Returns or sets a value that is returned to the parent form when the button is clicked. (Default: None)
Value: One of the DialogResult values. The default value is None.
Display
Display: Returns or sets the Display mode of the control to determine whether to display the icon, the text or both. (Default: Both)
Value: One of the Display values. The default is Both.
ImageSpacing
Nullable<Int32>: Returns or sets the distance in pixels between the image and the label inside the button. (Default: null)
MenuItems
MenuItemCollection: Returns the collection of MenuItem objects associated with the button.
Value: A MenuItemCollection that represents the list of MenuItem objects stored in the menu.
Repeat
Boolean: Enables or disables the auto-repeat feature. When enabled, the button keeps firing click events at an increasing rate while the user keeps the button pressed. (Default: False)
Shortcut
Shortcut: Returns or sets a value indicating the shortcut key associated with the button. (Default: None)
Value: One of the Shortcut values. The default is Shortcut.None.
Methods
Dispose(disposing)
Disposes the control.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | true when this method is called by the application rather than a finalizer. |
OnAddReferences(items)
Adds references components to the list. Referenced components can be added individually or as a reference to a collection.
| Parameter | Type | Description |
|---|---|---|
| items | IList | Container for the referenced components or collections. |
OnBindingContextChanged(e)
Fires the BindingContextChanged event.
OnClick(e)
Fires the Click event.
OnItemClick(e)
Fires the ItemClicked event.
| Parameter | Type | Description |
|---|---|---|
| e | MenuButtonItemClickedEventArgs | A MenuButtonItemClickedEventArgs that contains the event data. |
OnMenuCollapse(e) 3.5.5+
Fires the MenuCollapse event.
OnMenuPopup(e) 3.5.5+
Fires the MenuPopup event.
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
PerformClick()
Generates a Click event for a button.
Events
ItemClicked
MenuButtonItemClickedEventHandler Fired when the user clicks one of the drop down menu items.
MenuCollapse 3.5.5+
EventHandler Fired when the button menu is closed.
MenuPopup 3.5.5+
EventHandler Fired after the button menu is displayed on the client.
Inherited By
| Name | Description |
|---|---|
| SplitButton | Represents a split button control. |
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. |
| IButtonControl | Allows a control to act like a button on a Form. |
| ICommandSource | Defines an object that can invoke a Command. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IImage | Provides access to common image properties across the controls that implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |