Skip to main content
Version: 4.1

RadioButtonExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the RadioButton class.

public class RadioButtonExtensions

Methods

Static member Appearance<TRadioButton>(radioButton, appearance)

Sets the Appearance property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button for which to set the Appearance property.
appearanceAppearanceThe 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);

Static member AutoCheck<TRadioButton>(radioButton, value)

Sets the AutoCheck property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button for which to set the AutoCheck property.
valueBooleanA 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);

Static member AutoToolTip<TRadioButton>(radioButton, value)

Sets the AutoToolTip property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton and have an AutoToolTip property.
radioButtonTRadioButtonThe radio button for which to set the AutoToolTip property.
valueBooleanA 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);

Static member CheckAlign<TRadioButton>(radioButton, value)

Sets the CheckAlign property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button for which to set the CheckAlign property.
valueContentAlignmentThe 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);

Static member Checked<TRadioButton>(radioButton, value)

Sets the Checked property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button for which to set the Checked property.
valueBooleanA 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);

Static member CheckedForeColor<TRadioButton>(radioButton, color)

Sets the CheckedForeColor property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton and have a CheckedForeColor property.
radioButtonTRadioButtonThe radio button for which to set the CheckedForeColor property.
colorColorThe 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);

Static member Invalid<TRadioButton>(radioButton, value)

Sets the Invalid property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton and have an Invalid property.
radioButtonTRadioButtonThe radio button for which to set the Invalid property.
valueBooleanA 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);

Static member InvalidMessage<TRadioButton>(radioButton, message)

Sets the InvalidMessage property of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton and have an InvalidMessage property.
radioButtonTRadioButtonThe radio button for which to set the InvalidMessage property.
messageStringThe 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.");

Static member OnAppearanceChanged<TRadioButton>(radioButton, action)

Attaches an event handler for the AppearanceChanged event of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button to attach the event handler to.
actionAction<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!");
});

Static member OnCheckedChanged<TRadioButton>(radioButton, action)

Attaches an event handler for the CheckedChanged event of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton.
radioButtonTRadioButtonThe radio button to attach the event handler to.
actionAction<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!");
});

Static member OnReadOnlyChanged<TRadioButton>(radioButton, action)

Attaches an event handler for the ReadOnlyChanged event of the specified RadioButton.

ParameterTypeDescription
TRadioButtonThe type of the radio button, must inherit from RadioButton and have a ReadOnlyChanged event.
radioButtonTRadioButtonThe radio button to attach the event handler to.
actionAction<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!");
});