$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Editors Control for Windows Forms
Powerful data input control for WinForms application, flexible data entry controls, strict validation
Home > WinForms UI Controls > User Manual > C# Property in C#

Text Format Property of C# Text Edit Box Control

The Text Edit Box Control is a C# component which is capable of using the predefined themes included in the .NET UI WinForms Control. It is used to format and constrain text to a pattern that has been predefined or defined by users. This Text Edit Box Control entirely provides the support of globalization which allows users edit the date and time and navigation with the arrow keys like up and down.
The Text Format Property is offered to get a value from the Text property which is different from the editor that the end user finding. The Text Format Property is used to get the variations of the Text property value without considering the prompt characters, and the literals in the Text Editor Control. The valid values of the Text Format property contain ContainPromptNLiterals, ExcludePromptNLiterals, ContainPrompt, and ContainLiterals.
  • ContainPromptNLiterals, this value is the default value and will return the users’ text input and literal characters defined by instances of the prompt character.
  • ExcludePromptNLiterals, this value is used to return the users' text input.
  • ContainPrompt, this value is used to return the users’ text input and instances of the prompt character.
  • ContainLiterals, this value is used to return the users’ text input and literal characters.

How the Text Format Properties Works

The steps and C# code below shows how the text format properties work while utilizing text box control.
Define the text box with the C# code below.

this.ketticEditBox.TextType = Kettic.WinForms.UI.TextType.Standard;
this.ketticEditBox.Text = "(000) 000-0000";
this.ketticEditBox.PromptChar = '_';
Then, when we input the a number type, "000123456", which is less one character that the type defined in the prompt places, so the result in the UI KetticEditBox will be "(000) 123-456_"
The above sample demonstrates that we will have the prompt character instance '_', literals: '(' , ')', '-' and ' ' (empty space), as well as user input: "0001234567". And the value property of the Text Edit Box control will display based on the text format value as below.
  • ContainPromptNLiterals, This value property will return the Text Format value look like, (000) 123-456_
  • ExcludePromptNLiterals, This value property will return the Text Format value look like, 000123456
  • ContainPrompt, This value property will return the Text Format value look like, 000123456_
  • ContainLiterals, This value property will return the Text Format value look like, (000) 123-456
The steps and C# code below shows how the text format properties work while defining the currency utilizing text box control.
Define the currency text box with the C# code below:

this.ketticEditBox.TextType = Kettic.WinForm.UI.TextType.Numeric;
this.ketticEditBox.Text = "C2";
Then, when we input a number type, "-1234.56", which misses the dollar symbol and the comma between 1 and 234, so the result in the UI KetticEditBox will be "-$1,234.56"
The above sample demonstrates that we will have Literals: '$' and '. However, the ''-' and '.' are a part of the real decimal value and the prompt characters will not be included. And the value property of the Text Edit Box control will display based on the text format value as below.
  • ContainPromptNLiterals, This value property will return the Text Format value look like, -$1,234.56
  • ExcludePromptNLiterals, This value property will return the Text Format value look like, -1234.56
  • ContainPrompt, This value property will return the Text Format value look like, -1234.56
  • ContainLiterals, This value property will return the Text Format value look like, -$1,234.56
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls