Multiline TextBox : TextBox « GUI Windows Forms « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C# / CSharp Tutorial » GUI Windows Forms » TextBox 
22. 17. 12. Multiline TextBox
Multiline TextBox
using System;
using System.ComponentModel;
using System.Windows.Forms;

public class TextBoxMultiline : System.Windows.Forms.Form
{
    private System.ComponentModel.Container components = null;
  private System.Windows.Forms.Button btnPasswordDecoderRing;
  private System.Windows.Forms.Label label3;
  private System.Windows.Forms.TextBox passwordBox;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.TextBox capsOnlyBox;
  private System.Windows.Forms.Button btnGetMultiLineText;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.TextBox multiLineBox;

    public TextBoxMultiline()
    {
        InitializeComponent();
    CenterToScreen();
    }

  protected override void Disposebool disposing )
  {
    ifdisposing )
    {
      if (components != null
      {
        components.Dispose();
      }
    }
    base.Disposedisposing );
  }

  private void InitializeComponent()
  {
    this.capsOnlyBox = new System.Windows.Forms.TextBox();
    this.multiLineBox = new System.Windows.Forms.TextBox();
    this.label1 = new System.Windows.Forms.Label();
    this.label2 = new System.Windows.Forms.Label();
    this.passwordBox = new System.Windows.Forms.TextBox();
    this.btnGetMultiLineText = new System.Windows.Forms.Button();
    this.btnPasswordDecoderRing = new System.Windows.Forms.Button();
    this.label3 = new System.Windows.Forms.Label();
    this.SuspendLayout();
    // 
    // capsOnlyBox
    // 
    this.capsOnlyBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
    this.capsOnlyBox.Location = new System.Drawing.Point(14176);
    this.capsOnlyBox.Name = "capsOnlyBox";
    this.capsOnlyBox.Size = new System.Drawing.Size(12020);
    this.capsOnlyBox.TabIndex = 3;
    this.capsOnlyBox.Text = "";
    // 
    // multiLineBox
    // 
    this.multiLineBox.AcceptsReturn = true;
    this.multiLineBox.AcceptsTab = true;
    this.multiLineBox.Location = new System.Drawing.Point(1528);
    this.multiLineBox.Multiline = true;
    this.multiLineBox.Name = "multiLineBox";
    this.multiLineBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    this.multiLineBox.Size = new System.Drawing.Size(240104);
    this.multiLineBox.TabIndex = 0;
    this.multiLineBox.Text = "Type some stuff here (and hit the return and tab keys...)";
    // 
    // label1
    // 
    this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif"10F);
    this.label1.Location = new System.Drawing.Point(88);
    this.label1.Name = "label1";
    this.label1.Size = new System.Drawing.Size(13656);
    this.label1.TabIndex = 1;
    this.label1.Text = "A multiline textbox that accepts tabs and return keystrokes.";
    // 
    // label2
    // 
    this.label2.Font = new System.Drawing.Font("Comic Sans MS"12F);
    this.label2.Location = new System.Drawing.Point(14144);
    this.label2.Name = "label2";
    this.label2.Size = new System.Drawing.Size(10624);
    this.label2.TabIndex = 4;
    this.label2.Text = "Caps only!!";
    // 
    // passwordBox
    // 
    this.passwordBox.Location = new System.Drawing.Point(160176);
    this.passwordBox.Name = "passwordBox";
    this.passwordBox.PasswordChar = '$';
    this.passwordBox.Size = new System.Drawing.Size(23220);
    this.passwordBox.TabIndex = 5;
    this.passwordBox.Text = "COM seems so old fashion";
    // 
    // btnGetMultiLineText
    // 
    this.btnGetMultiLineText.Location = new System.Drawing.Point(1372);
    this.btnGetMultiLineText.Name = "btnGetMultiLineText";
    this.btnGetMultiLineText.Size = new System.Drawing.Size(12032);
    this.btnGetMultiLineText.TabIndex = 2;
    this.btnGetMultiLineText.Text = "Get Text";
    this.btnGetMultiLineText.Click += new System.EventHandler(this.btnGetMultiLineText_Click);
    // 
    // btnPasswordDecoderRing
    // 
    this.btnPasswordDecoderRing.Location = new System.Drawing.Point(280144);
    this.btnPasswordDecoderRing.Name = "btnPasswordDecoderRing";
    this.btnPasswordDecoderRing.Size = new System.Drawing.Size(11224);
    this.btnPasswordDecoderRing.TabIndex = 7;
    this.btnPasswordDecoderRing.Text = "Decode Password";
    this.btnPasswordDecoderRing.Click += new System.EventHandler(this.btnPasswordDecoderRing_Click);
    // 
    // label3
    // 
    this.label3.Font = new System.Drawing.Font("Comic Sans MS"12F);
    this.label3.Location = new System.Drawing.Point(152144);
    this.label3.Name = "label3";
    this.label3.Size = new System.Drawing.Size(12024);
    this.label3.TabIndex = 6;
    this.label3.Text = "Password Box";
    // 
    // TextBoxMultiline
    // 
    this.AutoScaleBaseSize = new System.Drawing.Size(513);
    this.ClientSize = new System.Drawing.Size(408221);
    this.Controls.Add(this.btnPasswordDecoderRing);
    this.Controls.Add(this.label3);
    this.Controls.Add(this.passwordBox);
    this.Controls.Add(this.label2);
    this.Controls.Add(this.capsOnlyBox);
    this.Controls.Add(this.btnGetMultiLineText);
    this.Controls.Add(this.label1);
    this.Controls.Add(this.multiLineBox);
    this.Name = "TextBoxMultiline";
    this.Text = "TextBox Types";
    this.ResumeLayout(false);

  }

  protected void btnPasswordDecoderRing_Click (object sender, System.EventArgs e)
  {
    MessageBox.Show(passwordBox.Text, "Your password is:");
  }

  protected void btnGetMultiLineText_Click (object sender, System.EventArgs e)
  {
    MessageBox.Show(multiLineBox.Text, "Here is your text");
  }

    public static void Main(string[] args
    {
        Application.Run(new TextBoxMultiline());
    }
}
22. 17. TextBox
22. 17. 1. Get input value from TextBox and display it vis a messagebox
22. 17. 2. TextBox key pressed event
22. 17. 3. TextBox Modified and TextChangedTextBox Modified and TextChanged
22. 17. 4. TextBox: Multiline and BorderStyleTextBox: Multiline and BorderStyle
22. 17. 5. TextBox Keyevent handerTextBox Keyevent hander
22. 17. 6. TextBox cancel eventTextBox cancel event
22. 17. 7. Count lines in the TextBox and read text in TextBox line by lineCount lines in the TextBox and read text in TextBox line by line
22. 17. 8. TextBox selectionTextBox selection
22. 17. 9. TextBox validationTextBox validation
22. 17. 10. Add ContextMenu to TextBoxAdd ContextMenu to TextBox
22. 17. 11. Use Regular Expression to Check the input for a TextBoxUse Regular Expression to Check the input for a TextBox
22. 17. 12. Multiline TextBoxMultiline TextBox
w_w_w_.j___a___v___a_2_s_.co___m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.