TextBox and button on form : 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.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » TextBoxScreenshots 
TextBox and button on form
TextBox and button on form

/*
C# Programming Tips & Techniques
by Charles Wright, Kris Jamsa

Publisher: Osborne/McGraw-Hill (December 28, 2001)
ISBN: 0072193794
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Form
{
  /// <summary>
  /// Summary description for ButtonTextForm.
  /// </summary>
  public class ButtonTextForm : System.Windows.Forms.Form
  {
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Button button2;
    private System.Windows.Forms.TextBox textBox1;
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.Container components = null;

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

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


    #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.button1 = new System.Windows.Forms.Button();
      this.button2 = new System.Windows.Forms.Button();
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.SuspendLayout();
      // 
      // button1
      // 
      this.button1.Location = new System.Drawing.Point(61159);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(8537);
      this.button1.TabIndex = 1;
      this.button1.Text = "button1";
      // 
      // button2
      // 
      this.button2.Location = new System.Drawing.Point(196159);
      this.button2.Name = "button2";
      this.button2.Size = new System.Drawing.Size(9537);
      this.button2.TabIndex = 2;
      this.button2.Text = "button2";
      // 
      // textBox1
      // 
      this.textBox1.Location = new System.Drawing.Point(4137);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(26222);
      this.textBox1.TabIndex = 0;
      this.textBox1.Text = "textBox1";
      // 
      // ButtonTextForm
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(615);
      this.ClientSize = new System.Drawing.Size(340280);
      this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                      this.button1,
                                      this.button2,
                                      this.textBox1});
      this.Name = "ButtonTextForm";
      this.Text = "ButtonTextForm";
      this.Load += new System.EventHandler(this.ButtonTextForm_Load);
      this.ResumeLayout(false);

    }
    #endregion

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

    private void ButtonTextForm_Load(object sender, System.EventArgs e)
    {

    }

    private void button2_Click(object sender, System.EventArgs e)
    {
      Application.Exit ();
    }

    private void button1_Click(object sender, System.EventArgs e)
    {
      MessageBox.Show (this,
        textBox1.Text, "Text Box",
        MessageBoxButtons.OKCancel,
        MessageBoxIcon.Exclamation);
    }
  }
}


           
       
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 ListBoxTextBox and ListBox
13.Label, TextBox and ButtonLabel, TextBox and Button
14.TextBox DemoTextBox Demo
15.Simple Editor based on TextBox
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.