$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Text Box Control for Windows Forms
Highly customizable and themable Text Box Control for Windows Forms C# project
Home > WinForms UI Controls > User Manual > Text Editing in C#

C# Text Editing in Text Box Control

The Kettic Text Box Control are build for .NET UI designers to retrieve the input string that are typed by users or show the text in the text box control and display multiple lines in C#, wrap text to fit the text box size in C#, add basic formatting in C#, apply themes in C#. To edit text in Text Box C# control, it uses the edition point to adjust the caret position and selection. When the Text Box control is focused, the editing position will be visible.

C# Code to Edit Text in Text Box

If developers need to add text in C# code to Text Box, they may need to use the Add method at the specific location. The sample below adds text to the location that is controlled by the SelectBegin property. The added text will take place the chosen text when the value of SelectWidth property is larger than 0.

private void Insert()
this.ketticTextBoxControl.Text = "Dark";
this.ketticTextBoxControl.CaretIndex = 0;
Furthermore, if developers need to add text at the end content of the Kettic Text Box Control, the AppendText method is necessary to achieve this.

private void AppendText()
this.ketticTextBoxControl.Text = "Lance";
To delete the chosen text or characters at the caret position in the Text Box control, we need to use the Delete method to achieve this.

private void DeleteSelection()
this.ketticTextBoxControl.Text = "Steven Lance";
this.ketticTextBoxControl.Chosen(0, 5);
When we are performing the text editing, the TextChange and TextChanged events will be raised. Or else, we can prevent the operation via subscribing to the TextChange event

private void ketticTextBoxControl_TextChange(object sender, Kettic.WinForms.TextChangeEventArgs e)
e.Cancel = string.IsNullOrEmpty(e.NewValue);
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