RadioButtonExtensions
Namespace: Wisej.Web.Markup
Assembly: Wisej.Framework (4.1.0.0)
Adds fluent markup extension methods to the RadioButton class.
- C#
- VB.NET
public class RadioButtonExtensions
Public Class RadioButtonExtensions
Methods
Appearance<TRadioButton>(radioButton, appearance)
Sets the Appearance property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button for which to set the Appearance property. |
| appearance | Appearance | The Appearance to set for the radio button. |
Returns: TRadioButton. The modified radio button with the updated Appearance property.
This method allows you to specify the appearance of the radio button.
myRadioButton.Appearance(Appearance.Button);
AutoCheck<TRadioButton>(radioButton, value)
Sets the AutoCheck property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button for which to set the AutoCheck property. |
| value | Boolean | A boolean indicating whether the radio button is automatically checked when clicked. |
Returns: TRadioButton. The modified radio button with the updated AutoCheck property.
This method allows you to enable or disable automatic checking of the radio button when it is clicked.
myRadioButton.AutoCheck(false);
AutoToolTip<TRadioButton>(radioButton, value)
Sets the AutoToolTip property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton and have an AutoToolTip property. | |
| radioButton | TRadioButton | The radio button for which to set the AutoToolTip property. |
| value | Boolean | A boolean indicating whether tooltips are automatically shown for the radio button. |
Returns: TRadioButton. The modified radio button with the updated AutoToolTip property.
This method allows you to enable or disable automatic tooltips for the radio button.
myRadioButton.AutoToolTip(true);
CheckAlign<TRadioButton>(radioButton, value)
Sets the CheckAlign property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button for which to set the CheckAlign property. |
| value | ContentAlignment | The ContentAlignment to set for the check mark alignment. |
Returns: TRadioButton. The modified radio button with the updated CheckAlign property.
This method allows you to specify the alignment of the check mark within the radio button.
myRadioButton.CheckAlign(ContentAlignment.MiddleRight);
Checked<TRadioButton>(radioButton, value)
Sets the Checked property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button for which to set the Checked property. |
| value | Boolean | A boolean indicating whether the radio button is checked. |
Returns: TRadioButton. The modified radio button with the updated Checked property.
This method allows you to specify whether the radio button is checked.
myRadioButton.Checked(true);
CheckedForeColor<TRadioButton>(radioButton, color)
Sets the CheckedForeColor property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton and have a CheckedForeColor property. | |
| radioButton | TRadioButton | The radio button for which to set the CheckedForeColor property. |
| color | Color | The Color to set for the checked state text color. |
Returns: TRadioButton. The modified radio button with the updated CheckedForeColor property.
This method allows you to specify the text color when the radio button is checked.
myRadioButton.CheckedForeColor(Color.Red);
Invalid<TRadioButton>(radioButton, value)
Sets the Invalid property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton and have an Invalid property. | |
| radioButton | TRadioButton | The radio button for which to set the Invalid property. |
| value | Boolean | A boolean indicating whether the radio button is in an invalid state. |
Returns: TRadioButton. The modified radio button with the updated Invalid property.
This method allows you to specify whether the radio button is in an invalid state.
myRadioButton.Invalid(true);
InvalidMessage<TRadioButton>(radioButton, message)
Sets the InvalidMessage property of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton and have an InvalidMessage property. | |
| radioButton | TRadioButton | The radio button for which to set the InvalidMessage property. |
| message | String | The message to set for the invalid state. |
Returns: TRadioButton. The modified radio button with the updated InvalidMessage property.
This method allows you to specify a custom message to display when the radio button is in an invalid state.
myRadioButton.InvalidMessage("This option is not valid.");
OnAppearanceChanged<TRadioButton>(radioButton, action)
Attaches an event handler for the AppearanceChanged event of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button to attach the event handler to. |
| action | Action<TRadioButton> | An action to execute when the appearance changes. |
Returns: TRadioButton. The modified radio button with the attached AppearanceChanged event handler.
This method allows you to execute a custom action whenever the appearance of the radio button changes.
myRadioButton.OnAppearanceChanged(rb =>
{
AlertBox.Show("Appearance changed!");
});
OnCheckedChanged<TRadioButton>(radioButton, action)
Attaches an event handler for the CheckedChanged event of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton. | |
| radioButton | TRadioButton | The radio button to attach the event handler to. |
| action | Action<TRadioButton> | An action to execute when the checked state changes. |
Returns: TRadioButton. The modified radio button with the attached CheckedChanged event handler.
This method allows you to execute a custom action whenever the checked state of the radio button changes.
myRadioButton.OnCheckedChanged(rb =>
{
AlertBox.Show("Checked state changed!");
});
OnReadOnlyChanged<TRadioButton>(radioButton, action)
Attaches an event handler for the ReadOnlyChanged event of the specified RadioButton.
| Parameter | Type | Description |
|---|---|---|
| TRadioButton | The type of the radio button, must inherit from RadioButton and have a ReadOnlyChanged event. | |
| radioButton | TRadioButton | The radio button to attach the event handler to. |
| action | Action<TRadioButton> | An action to execute when the read-only state changes. |
Returns: TRadioButton. The modified radio button with the attached ReadOnlyChanged event handler.
This method allows you to execute a custom action whenever the read-only state of the radio button changes.
myRadioButton.OnReadOnlyChanged(rb =>
{
AlertBox.Show("Read-only state changed!");
});