Customer Entry Application with TabControl : TabControl « GUI Windows Forms « C# / CSharp Tutorial

Home
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.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » GUI Windows Forms » TabControl 
23.35.2.Customer Entry Application with TabControl
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

  public class Form1 : Form
  {
    private TabControl tabControl1;
    private TabPage tabPage1;
    private TabPage tabPage2;
    private TabPage tabPage3;
    private Label formLabel;
    private TextBox lastNameTextBox;
    private Label lastNameLabel;
    private TextBox miTextBox;
    private Label middleInitialLabel;
    private TextBox firstNameTextBox;
    private Label firstNameLabel;
    private TextBox zipCodeBox;
    private ComboBox stateBox;
    private Label stateLabel;
    private TextBox cityBox;
    private Label cityLabel;
    private TextBox streetTextBox;
    private Label streetLabel;
    private RadioButton NoRadioButton;
    private RadioButton YesRadioButton;
    private CheckBox Over35Box;
    private CheckBox B1835Box;
    private CheckBox Under18Box;
    private Label marriedLabel;
    private Label ageGroupLabel;
    private Button NewButton;
    private Button UpdateButton;
    private Button DeleteButton;
    private System.ComponentModel.Container components = null;

    public Form1()
    {

      this.tabControl1 = new TabControl();
      this.tabPage1 = new TabPage();
      this.tabPage2 = new TabPage();
      this.tabPage3 = new TabPage();
      this.formLabel = new Label();
      this.lastNameTextBox = new TextBox();
      this.lastNameLabel = new Label();
      this.miTextBox = new TextBox();
      this.middleInitialLabel = new Label();
      this.firstNameTextBox = new TextBox();
      this.firstNameLabel = new Label();
      this.zipCodeBox = new TextBox();
      this.stateBox = new ComboBox();
      this.stateLabel = new Label();
      this.cityBox = new TextBox();
      this.cityLabel = new Label();
      this.streetTextBox = new TextBox();
      this.streetLabel = new Label();
      this.NoRadioButton = new RadioButton();
      this.YesRadioButton = new RadioButton();
      this.Over35Box = new CheckBox();
      this.B1835Box = new CheckBox();
      this.Under18Box = new CheckBox();
      this.marriedLabel = new Label();
      this.ageGroupLabel = new Label();
      this.NewButton = new Button();
      this.UpdateButton = new Button();
      this.DeleteButton = new Button();
      this.tabControl1.SuspendLayout();
      this.tabPage1.SuspendLayout();
      this.tabPage2.SuspendLayout();
      this.tabPage3.SuspendLayout();
      this.SuspendLayout();
      // 
      // tabControl1
      // 
      this.tabControl1.Controls.Add(this.tabPage1);
      this.tabControl1.Controls.Add(this.tabPage2);
      this.tabControl1.Controls.Add(this.tabPage3);
      this.tabControl1.Location = new Point(016);
      this.tabControl1.Name = "tabControl1";
      this.tabControl1.SelectedIndex = 0;
      this.tabControl1.Size = new Size(312136);
      this.tabControl1.TabIndex = 10;
      // 
      // tabPage1
      // 
      this.tabPage1.Controls.Add(this.lastNameTextBox);
      this.tabPage1.Controls.Add(this.lastNameLabel);
      this.tabPage1.Controls.Add(this.miTextBox);
      this.tabPage1.Controls.Add(this.middleInitialLabel);
      this.tabPage1.Controls.Add(this.firstNameTextBox);
      this.tabPage1.Controls.Add(this.firstNameLabel);
      this.tabPage1.Location = new Point(422);
      this.tabPage1.Name = "tabPage1";
      this.tabPage1.Size = new Size(304110);
      this.tabPage1.TabIndex = 0;
      this.tabPage1.Text = "Basic";
      // 
      // tabPage2
      // 
      this.tabPage2.Controls.Add(this.zipCodeBox);
      this.tabPage2.Controls.Add(this.stateBox);
      this.tabPage2.Controls.Add(this.stateLabel);
      this.tabPage2.Controls.Add(this.cityBox);
      this.tabPage2.Controls.Add(this.cityLabel);
      this.tabPage2.Controls.Add(this.streetTextBox);
      this.tabPage2.Controls.Add(this.streetLabel);
      this.tabPage2.Location = new Point(422);
      this.tabPage2.Name = "tabPage2";
      this.tabPage2.Size = new Size(304110);
      this.tabPage2.TabIndex = 1;
      this.tabPage2.Text = "Address";
      // 
      // tabPage3
      // 
      this.tabPage3.Controls.Add(this.NoRadioButton);
      this.tabPage3.Controls.Add(this.YesRadioButton);
      this.tabPage3.Controls.Add(this.Over35Box);
      this.tabPage3.Controls.Add(this.B1835Box);
      this.tabPage3.Controls.Add(this.Under18Box);
      this.tabPage3.Controls.Add(this.marriedLabel);
      this.tabPage3.Controls.Add(this.ageGroupLabel);
      this.tabPage3.Location = new Point(422);
      this.tabPage3.Name = "tabPage3";
      this.tabPage3.Size = new Size(304110);
      this.tabPage3.TabIndex = 2;
      this.tabPage3.Text = "Other";
      // 
      // formLabel
      // 
      this.formLabel.Dock = DockStyle.Top;
      this.formLabel.Font = new Font("Microsoft Sans Serif"
                            8.25F, FontStyle.Bold, GraphicsUnit.Point, ((Byte)(0)));
      this.formLabel.Location = new Point(00);
      this.formLabel.Name = "formLabel";
      this.formLabel.Size = new Size(31216);
      this.formLabel.TabIndex = 1;
      this.formLabel.Text = "Customer Entry Form";
      this.formLabel.TextAlign = ContentAlignment.TopCenter;
      // 
      // lastNameTextBox
      // 
      this.lastNameTextBox.Location = new Point(12072);
      this.lastNameTextBox.Name = "lastNameTextBox";
      this.lastNameTextBox.Size = new Size(17620);
      this.lastNameTextBox.TabIndex = 4;
      this.lastNameTextBox.Text = "";
      // 
      // lastNameLabel
      // 
      this.lastNameLabel.Location = new Point(872);
      this.lastNameLabel.Name = "lastNameLabel";
      this.lastNameLabel.Size = new Size(10416);
      this.lastNameLabel.TabIndex = 10;
      this.lastNameLabel.Text = "Last Name";
      // 
      // miTextBox
      // 
      this.miTextBox.Location = new Point(12048);
      this.miTextBox.MaxLength = 1;
      this.miTextBox.Name = "miTextBox";
      this.miTextBox.Size = new Size(1620);
      this.miTextBox.TabIndex = 3;
      this.miTextBox.Text = "";
      // 
      // middleInitialLabel
      // 
      this.middleInitialLabel.Location = new Point(848);
      this.middleInitialLabel.Name = "middleInitialLabel";
      this.middleInitialLabel.Size = new Size(10416);
      this.middleInitialLabel.TabIndex = 7;
      this.middleInitialLabel.Text = "Middle Initial";
      // 
      // firstNameTextBox
      // 
      this.firstNameTextBox.Location = new Point(12024);
      this.firstNameTextBox.Name = "firstNameTextBox";
      this.firstNameTextBox.Size = new Size(17620);
      this.firstNameTextBox.TabIndex = 2;
      this.firstNameTextBox.Text = "";
      // 
      // firstNameLabel
      // 
      this.firstNameLabel.Location = new Point(824);
      this.firstNameLabel.Name = "firstNameLabel";
      this.firstNameLabel.Size = new Size(10416);
      this.firstNameLabel.TabIndex = 5;
      this.firstNameLabel.Text = "First Name";
      // 
      // zipCodeBox
      // 
      this.zipCodeBox.Location = new Point(21669);
      this.zipCodeBox.MaxLength = 5;
      this.zipCodeBox.Name = "zipCodeBox";
      this.zipCodeBox.Size = new Size(7220);
      this.zipCodeBox.TabIndex = 9;
      this.zipCodeBox.Text = "";
      // 
      // stateBox
      // 
      this.stateBox.Items.AddRange(new object[] {"PA","NJ","NY"});
      this.stateBox.Location = new Point(12069);
      this.stateBox.Name = "stateBox";
      this.stateBox.Size = new Size(4021);
      this.stateBox.TabIndex = 8;
      // 
      // stateLabel
      // 
      this.stateLabel.Location = new Point(869);
      this.stateLabel.Name = "stateLabel";
      this.stateLabel.Size = new Size(10416);
      this.stateLabel.TabIndex = 10;
      this.stateLabel.Text = "State";
      // 
      // cityBox
      // 
      this.cityBox.Location = new Point(12043);
      this.cityBox.MaxLength = 100;
      this.cityBox.Name = "cityBox";
      this.cityBox.Size = new Size(7220);
      this.cityBox.TabIndex = 7;
      this.cityBox.Text = "";
      // 
      // cityLabel
      // 
      this.cityLabel.Location = new Point(843);
      this.cityLabel.Name = "cityLabel";
      this.cityLabel.Size = new Size(10416);
      this.cityLabel.TabIndex = 9;
      this.cityLabel.Text = "City";
      // 
      // streetTextBox
      // 
      this.streetTextBox.Location = new Point(12021);
      this.streetTextBox.Name = "streetTextBox";
      this.streetTextBox.Size = new Size(17620);
      this.streetTextBox.TabIndex = 6;
      this.streetTextBox.Text = "";
      // 
      // streetLabel
      // 
      this.streetLabel.Location = new Point(821);
      this.streetLabel.Name = "streetLabel";
      this.streetLabel.Size = new Size(10416);
      this.streetLabel.TabIndex = 8;
      this.streetLabel.Text = "Street";
      // 
      // NoRadioButton
      // 
      this.NoRadioButton.Location = new Point(17255);
      this.NoRadioButton.Name = "NoRadioButton";
      this.NoRadioButton.Size = new Size(5624);
      this.NoRadioButton.TabIndex = 15;
      this.NoRadioButton.Text = "No";
      // 
      // YesRadioButton
      // 
      this.YesRadioButton.Location = new Point(10055);
      this.YesRadioButton.Name = "YesRadioButton";
      this.YesRadioButton.Size = new Size(5624);
      this.YesRadioButton.TabIndex = 14;
      this.YesRadioButton.Text = "Yes";
      // 
      // Over35Box
      // 
      this.Over35Box.Location = new Point(22831);
      this.Over35Box.Name = "Over35Box";
      this.Over35Box.Size = new Size(8024);
      this.Over35Box.TabIndex = 13;
      this.Over35Box.Text = "Over 35";
      // 
      // B1835Box
      // 
      this.B1835Box.Location = new Point(17231);
      this.B1835Box.Name = "B1835Box";
      this.B1835Box.Size = new Size(8024);
      this.B1835Box.TabIndex = 12;
      this.B1835Box.Text = "18 - 35";
      // 
      // Under18Box
      // 
      this.Under18Box.Location = new Point(10031);
      this.Under18Box.Name = "Under18Box";
      this.Under18Box.Size = new Size(8024);
      this.Under18Box.TabIndex = 11;
      this.Under18Box.Text = "Under 18";
      // 
      // marriedLabel
      // 
      this.marriedLabel.Location = new Point(855);
      this.marriedLabel.Name = "marriedLabel";
      this.marriedLabel.Size = new Size(10416);
      this.marriedLabel.TabIndex = 14;
      this.marriedLabel.Text = "Married?";
      // 
      // ageGroupLabel
      // 
      this.ageGroupLabel.Location = new Point(831);
      this.ageGroupLabel.Name = "ageGroupLabel";
      this.ageGroupLabel.Size = new Size(10416);
      this.ageGroupLabel.TabIndex = 13;
      this.ageGroupLabel.Text = "Age Group";
      // 
      // NewButton
      // 
      this.NewButton.Location = new Point(8160);
      this.NewButton.Name = "NewButton";
      this.NewButton.Size = new Size(9624);
      this.NewButton.TabIndex = 2;
      this.NewButton.Text = "New";
      // 
      // UpdateButton
      // 
      this.UpdateButton.Location = new Point(112160);
      this.UpdateButton.Name = "UpdateButton";
      this.UpdateButton.Size = new Size(9624);
      this.UpdateButton.TabIndex = 3;
      this.UpdateButton.Text = "Update";
      // 
      // DeleteButton
      // 
      this.DeleteButton.Location = new Point(216160);
      this.DeleteButton.Name = "DeleteButton";
      this.DeleteButton.Size = new Size(9624);
      this.DeleteButton.TabIndex = 4;
      this.DeleteButton.Text = "Delete";
      // 
      // Form1
      // 
      this.AutoScaleBaseSize = new Size(513);
      this.ClientSize = new Size(312189);
      this.Controls.Add(this.DeleteButton);
      this.Controls.Add(this.UpdateButton);
      this.Controls.Add(this.NewButton);
      this.Controls.Add(this.formLabel);
      this.Controls.Add(this.tabControl1);
      this.Name = "Form1";
      this.Text = "Customer Entry Application";
      this.tabControl1.ResumeLayout(false);
      this.tabPage1.ResumeLayout(false);
      this.tabPage2.ResumeLayout(false);
      this.tabPage3.ResumeLayout(false);
      this.ResumeLayout(false);

    }
    [STAThread]
    static void Main() 
    {
      Application.Run(new Form1());
    }

  }
23.35.TabControl
23.35.1.Add TabPage to TabControlAdd TabPage to TabControl
23.35.2.Customer Entry Application with TabControl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.