Class TextBoxAndLabel
[ControlCategory("Editors")]
public class TextBoxAndLabel : ControlAndLabel, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, IControlAndLabel, INotifyDataErrorInfo
- Inheritance
-
TextBoxAndLabel
- Implements
- Derived
Examples
Here is how to declare a TextBoxAndLabel in UIXML:
<TextBoxAndLabel Text="some value" Title="Short Label" Name="control1"
TextChanged="TextBoxTextChanged" Margin="10"/>
And the corresponding event handler in the code-behind:
public void TextBoxTextChanged(object? sender, EventArgs e)
{
Application.Log($"TextBox {(sender as Control)?.Name} Text changed");
}
Also, a TextBoxAndLabel can be created from code:
TextBoxAndLabel control = new();
control.Margin = 10;
control.Text = "some value 2";
control.Title = "This is very long label";
control.Parent = mainPanel;
control.Name = "control2";
control.TextChanged += TextBoxTextChanged;
control.InnerSuggestedWidth = 200;
Remarks
Example of how a TextBoxAndLabel can look:
Constructors
- TextBoxAndLabel()
Initializes a new instance of the TextBoxAndLabel class.
- TextBoxAndLabel(string, string?)
Initializes a new instance of the TextBoxAndLabel class.
Properties
- IsNullOrEmpty
Gets whether Text is null or empty.
- IsNullOrWhiteSpace
Gets whether Text is null or white space.
- IsValidMail
Gets whether editor contains a valid e-mail address.
- MainControl
Gets main child control.
- TextBox
Gets main child control, same as MainControl.
Methods
- BindHandlerEvents()
Binds events to the handler.
- CreateControl()
Creates main child control.
- Init()
Initializes main child control.
- MainControlTextChanged()
Called when text is changed in the main child control.