Button
The Button component provides a push button control.
You can use this control to let users start actions. It is completely customizable through properties such as BorderRadius or Gradient, and additionally you can create image-based buttons through its ImageSource property.
Contents
Client-side Features
The component generates the following client-side DOM elements:
- Wrapper (HTMLDivElement). Access it with
$("#ComponentName_outer").get()[0]
.- Main element (HTMLInputElement). Access it with:
$("#ComponentName").get()[0]
.
- Main element (HTMLInputElement). Access it with:
Client-side Events
This component inherits the following client-side events:
- From ButtonControl: OnSelect.
- From Control: OnBlur, OnChange, OnClick, OnDblClick, OnDragOver, OnDragStart, OnFocus, OnKeyDown, OnKeyPress, OnKeyUp, OnMosueDown, OnMouseMove, OnMouseOut, OnMouseOver, OnMouseUp.
Server-side Features
Properties
In addition to its own properties (documented below), this component also inherits the following:
- From ButtonControl: DataField, DataSource, TabOrder, TabStop.
- From Control: Caption, Color, Enabled, Font, ParentColor, ParentFont, ParentShowHint, ShowHint, Style, Visible.
ButtonType
Type of button to be used, according to the expected behavior.
The possible values are:
- btSubmit. Submits the page's HTML form when clicked.
- btReset. Resets the input fields (Edit, ComboBox, etc.) in the page's HTML form back to their initial values.
- btNormal. Regular button, with no default effect (you need to define server or client-side events to add interaction to it).
Default
Whether the handler for the OnClick event should be executed when the Enter key is pressed (true
), or not (false
).
If this property is set to true
, the control will behave as if the ButtonType were btSubmit, no matter what its actual value is.
ImageSource
Path to an image file to be used for the surface of the control.
To avoid distortion, make sure the Height and Width of the control matches those of the image file.
Server-side Events
This component inherits the following server-side events:
- From ButtonControl: OnClick.
- From Control: OnAfterShow, OnBeforeShow, OnShow.
Inheritance
- Parent: ButtonControl.
- Children:
- Classes: CustomMButton.
Help Resources
Sample Applications
In the following folders inside the sample applications directory you will find projects covering this component:
- Button. How to use the component.