Class GPALButton
A GPAL button instantiated with GPAL.Button for use on GPAL forms.
Callback EventHandler is invoked on the GPALButton.WindowsControl.Clicked event.
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: GenerallyPositive.GPALForm
Assembly: GPAL.dll
Syntax
public class GPALButton : GPALControl, IAllowControlSettingsAndFontSettings, IAllowFontSettings, IAllowControlSettingsEnabledAndDefault, IAllowControlSettings, IAllowEnabled, IAllowDefault
Examples
static GPALButton gPalButton1 = (GPALButton)GPAL.Button
.Default
.WithName("button1")
.WithText("Exit")
.WithCallback(ExitButtonClickHandler)
.WithShortcutKey(System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.E); // Alt-E
static void Main(string[] args)
{
GPALForm myForm = (GPALForm)GPAL.Form
.WithTitle("Simple Form Test")
.WithFormControl(gPalButton1)
.ShowDialog();
}
private static void ExitButtonClickHandler(object sender, EventArgs e)
{
Control control = (Control)sender;
while (null != control.Parent)
control = control.Parent;
control.Hide();
}
Properties
Default
Fluent interface to designate this button as the default button.
NOTE: Do NOT define more than one default. Only the last one added to the form is the default.
Declaration
public IAllowControlSettingsEnabledAndDefault Default { get; }
Property Value
| Type | Description |
|---|---|
| IAllowControlSettingsEnabledAndDefault | Fluent interface to define more settings |
Enabled
Runtime access to Enable/Disable the button.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True [default] - enabled |
Methods
WithEnabled(Boolean)
Fluent interface to set the initial state of the control
Declaration
public IAllowControlSettings WithEnabled(bool enabled)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | enabled |
Returns
| Type | Description |
|---|---|
| IAllowControlSettings | Fluent interface to define more settings |