TextBox Demo : TextBox « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » TextBoxScreenshots 
TextBox Demo
TextBox Demo

/*
Professional Windows GUI Programming Using C#
by Jay Glynn, Csaba Torok, Richard Conway, Wahid Choudhury, 
   Zach Greenvoss, Shripad Kulkarni, Neil Whitlow

Publisher: Peer Information
ISBN: 1861007663
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace TextBox
{
    /// <summary>
    /// Summary description for TextBox.
    /// </summary>
    public class TextBox : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.TextBox SINGLE_LINE;
        private System.Windows.Forms.TextBox PASSWORD_LINE;
        private System.Windows.Forms.TextBox MULTI_LINE;
        private System.Windows.Forms.RichTextBox RICH_EDIT;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public TextBox()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Disposebool disposing )
        {
            ifdisposing )
            {
                if (components != null
                {
                    components.Dispose();
                }
            }
            base.Disposedisposing );
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.SINGLE_LINE = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.PASSWORD_LINE = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.MULTI_LINE = new System.Windows.Forms.TextBox();
            this.RICH_EDIT = new System.Windows.Forms.RichTextBox();
            this.label4 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // SINGLE_LINE
            // 
            this.SINGLE_LINE.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.SINGLE_LINE.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(128))((System.Byte)(64))((System.Byte)(64)));
            this.SINGLE_LINE.Location = new System.Drawing.Point(3240);
            this.SINGLE_LINE.Name = "SINGLE_LINE";
            this.SINGLE_LINE.Size = new System.Drawing.Size(40820);
            this.SINGLE_LINE.TabIndex = 0;
            this.SINGLE_LINE.Text = "THIS IS A SINGLELINE EDIT CONTROL";
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(3224);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(16816);
            this.label1.TabIndex = 1;
            this.label1.Text = "Single Line TextBox";
            // 
            // PASSWORD_LINE
            // 
            this.PASSWORD_LINE.Font = new System.Drawing.Font("Microsoft Sans Serif"9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.PASSWORD_LINE.Location = new System.Drawing.Point(32104);
            this.PASSWORD_LINE.Name = "PASSWORD_LINE";
            this.PASSWORD_LINE.PasswordChar = '^';
            this.PASSWORD_LINE.Size = new System.Drawing.Size(10422);
            this.PASSWORD_LINE.TabIndex = 2;
            this.PASSWORD_LINE.Text = "";
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(3280);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(16016);
            this.label2.TabIndex = 3;
            this.label2.Text = "Password TextBox";
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(32136);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(12016);
            this.label3.TabIndex = 4;
            this.label3.Text = "MultiLine TextBox";
            // 
            // MULTI_LINE
            // 
            this.MULTI_LINE.AcceptsReturn = true;
            this.MULTI_LINE.AcceptsTab = true;
            this.MULTI_LINE.Font = new System.Drawing.Font("Microsoft Sans Serif"9.75F(System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic), System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.MULTI_LINE.ForeColor = System.Drawing.SystemColors.HotTrack;
            this.MULTI_LINE.Location = new System.Drawing.Point(32160);
            this.MULTI_LINE.MaxLength = 10000;
            this.MULTI_LINE.Multiline = true;
            this.MULTI_LINE.Name = "MULTI_LINE";
            this.MULTI_LINE.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.MULTI_LINE.Size = new System.Drawing.Size(408104);
            this.MULTI_LINE.TabIndex = 5;
            this.MULTI_LINE.Text = "";
            // 
            // RICH_EDIT
            // 
            this.RICH_EDIT.Font = new System.Drawing.Font("Verdana"9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.RICH_EDIT.ForeColor = System.Drawing.Color.Red;
            this.RICH_EDIT.Location = new System.Drawing.Point(32296);
            this.RICH_EDIT.Name = "RICH_EDIT";
            this.RICH_EDIT.ShowSelectionMargin = true;
            this.RICH_EDIT.Size = new System.Drawing.Size(408120);
            this.RICH_EDIT.TabIndex = 6;
            this.RICH_EDIT.Text = "richTextBox1";
            this.RICH_EDIT.ZoomFactor = 4.999695F;
            // 
            // label4
            // 
            this.label4.Location = new System.Drawing.Point(32272);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(15216);
            this.label4.TabIndex = 7;
            this.label4.Text = "RichEdit Text Box";
            // 
            // TextBox
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(513);
            this.ClientSize = new System.Drawing.Size(464453);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.label4,
                                                                          this.RICH_EDIT,
                                                                          this.MULTI_LINE,
                                                                          this.label3,
                                                                          this.label2,
                                                                          this.PASSWORD_LINE,
                                                                          this.label1,
                                                                          this.SINGLE_LINE});
            this.Name = "TextBox";
            this.Text = "TextBox Controls";
            this.Load += new System.EventHandler(this.TextBox_Load);
            this.ResumeLayout(false);

        }
        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() 
        {
            Application.Run(new TextBox());
        }

        private void TextBox_Load(object sender, System.EventArgs e)
        {
            RICH_EDIT.LoadFile("c:\\temp\\RTFDOC.RTF");     
        }
    }
}


           
       
Related examples in the same category
1.Add ScrollBars to TextBox
2.new TextBox(), Localtion, Name, TabIndex, Text
3.TextBox locationTextBox location
4.Keyboard event and TextBox
5.Get value from TextBox
6.Text Changed eventText Changed event
7.A simple text editorA simple text editor
8.Convert TextBox input to double valueConvert TextBox input to double value
9.All cap text textboxAll cap text textbox
10.Data CheckerData Checker
11.User EventsUser Events
12.TextBox and button on formTextBox and button on form
13.TextBox and ListBoxTextBox and ListBox
14.Label, TextBox and ButtonLabel, TextBox and Button
15.Simple Editor based on TextBox
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.