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:
    
        - Left
 
        - Right
 
        - Center
 
    
    
    Example:
    
    
    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.
    
    
    Change the property using code:
private void Form1_Load(object sender, EventArgs e)
{
	textInput.TextAlign = HorizontalAlignment.Right;
}
    
    
  
    Advertisement
    
    
    
  
  
    Advertisement