TextBox.Anchor : TextBox « System.Windows.Forms « C# / C Sharp by API






TextBox.Anchor

  

using System;
using System.Drawing;
using System.Windows.Forms;

public class TextBoxTextChanged : Form
{
  TextBox txt;
  string strOriginal;

  public TextBoxTextChanged()
  {
    Size = new Size(300, 375);
               
    txt = new TextBox();
    txt.Parent = this;
    txt.Text = "Enter text here.";
    txt.Size = new Size(ClientSize.Width - 20, ClientSize.Height - 100);
    txt.Location = new Point(10,10);
    txt.Multiline = true;
    txt.BorderStyle = BorderStyle.Fixed3D;
    txt.ScrollBars = ScrollBars.Vertical;
    txt.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
    strOriginal = txt.Text;

  }

  static void Main() 
  {
    Application.Run(new TextBoxTextChanged());
  }
}  
    

   
    
  








Related examples in the same category

1.TextBox.AcceptsTab
2.TextBox.BorderStyle
3.TextBox.CanFocus
4.TextBox.Clear()
5.TextBox.Click
6.TextBox.ContextMenu
7.TextBox.ContainsFocus
8.TextBox.DataBindings
9.TextBox.DoDragDrop
10.TextBox.DragDrop
11.TextBox.DragEnter
12.TextBox.Focus()
13.TextBox.Focused
14.TextBox.GotFocus
15.TextBox.KeyPress
16.TextBox.Lines
17.TextBox.LostFocus
18.TextBox.Multiline
19.TextBox.MouseDown
20.TextBox.PasswordChar
21.TextBox.ScrollBars
22.TextBox.SelectAll()
23.TextBox.SelectedText
24.TextBox.SelectionLength
25.TextBox.TextChanged
26.TextBox.Validated
27.TextBox.Validating