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.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 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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.