Labeled TextBox

Text field and label are working hand in hand to provide clear description of input field. Label for each text field is important to tell user what value is expected. A good design is important to assist user to enter value correctly with minimum effort. Learn more about best practice of text box and label design here: Designing Perfect Text Field: Clarity, Accessibility and User Effort

In WinForms, text field (TextBox) and Label are 2 different components. A lot of repetitive steps need to be done when creating form with multiple text boxes, no to mentioned that when you need to create more forms.

We derived a component named LabeledTextbox which combine both Label and TextBox in one single component, simplify your form's design process and provide better control on width and size for label and text field. This component is part of the CodeArtEng.Controls library.


LABEL

Text for label and text box are accessible from property LabelText and Text. The size of the label can be adjusted from the following properties:

  • LabelAutoSize: Auto resize label based on it's content.
  • LabelWidth: Fixed size, set LabelAutoSize to FALSE before configure size.
  • LabelTextAlign: Label text position.

TEXT BOX - HINT

Sometimes, it's helpful to provide further explanation o the text field to guide user to fill in the value correctly. Using the Hint property, sample input or short description can be added to text box. Value assigned to Hint will only visible when Text value is empty.

LabeledTextBox with Hint

CHECK BOX

On top of that, an optional check box is added to this component which can be used for enable / disable optional input field. 
  • ShowCheckBox: Show or Hide check box.
  • Checked: Get or set the check box checked status. Textbox is enabled when check box is checked.
LabeledTextBox with Check Box

DROP DOWN

If we only want user to select one of many listed option instead of manually enter the value, we can use a combo box instead. This is included in the LabeledTextBox control. Selected item can be read back via Text property.

  • IsDropDownList: Set to TRUE to use combo box.
  • DropDownListItems: Defined selection for combo box.


Popular posts from this blog

(AGauge) WinForms Gauge Control - Discontinued

C# DSP Simulation - DSP Lab

WinForms Controls