Home » .Net » C#.Net » C#.Net Windows Development

TextBox.TextAlign Property with Example in C#.Net

C#.Net - TextBox.TextAlign Property with Example: Here we are going to learn about the TextAlign property of TextBox Control in C#.Net Windows Application Development.
Submitted by IncludeHelp, on September 03, 2018

Here we are demonstrating use of TextAlign property of TextBox.

TextAlign property of TextBox is used to define alignment of the input text in the TextBox.

TextAlign property has three options:

  1. Left
  2. Right
  3. Center

Example:

TextBox.TextAlign Property 1

In this example, we took a Windows form that contains a TextBox named txtInput, we are setting TextAlign to "Right", that means Input text will be aligned to right side.

TextBox.TextAlign Property 2

Change the property using code:

private void Form1_Load(object sender, EventArgs e)
{
	textInput.TextAlign = HorizontalAlignment.Right;
}



Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.