using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace DemoApp
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.ToolBar toolBar;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.ToolBarButton toolBarButtonDemo1;
private System.Windows.Forms.ToolBarButton toolBarButtonDemo2;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.GroupBox groupBoxGraphics;
private System.Windows.Forms.PictureBox pictureBox;
private System.Windows.Forms.GroupBox groupBoxSettings;
private System.Windows.Forms.GroupBox groupBoxLog;
private System.Windows.Forms.ListBox listBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.NumericUpDown numericUpDown2;
private System.Windows.Forms.NumericUpDown numericUpDown3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.toolBar = new System.Windows.Forms.ToolBar();
this.toolBarButtonDemo1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButtonDemo2 = new System.Windows.Forms.ToolBarButton();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.tabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBoxGraphics = new System.Windows.Forms.GroupBox();
this.pictureBox = new System.Windows.Forms.PictureBox();
this.groupBoxSettings = new System.Windows.Forms.GroupBox();
this.groupBoxLog = new System.Windows.Forms.GroupBox();
this.listBox = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.checkBox3 = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.tabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBoxGraphics.SuspendLayout();
this.groupBoxSettings.SuspendLayout();
this.groupBoxLog.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
this.SuspendLayout();
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem3});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2});
this.menuItem1.Text = "File";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "Exit";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem4});
this.menuItem3.Text = "Help";
//
// menuItem4
//
this.menuItem4.Index = 0;
this.menuItem4.Text = "About";
this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
//
// toolBar
//
this.toolBar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButtonDemo1,
this.toolBarButtonDemo2});
this.toolBar.DropDownArrows = true;
this.toolBar.ImageList = this.imageList;
this.toolBar.Name = "toolBar";
this.toolBar.ShowToolTips = true;
this.toolBar.Size = new System.Drawing.Size(648, 25);
this.toolBar.TabIndex = 0;
this.toolBar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar_ButtonClick);
//
// toolBarButtonDemo1
//
this.toolBarButtonDemo1.ImageIndex = 0;
//
// toolBarButtonDemo2
//
this.toolBarButtonDemo2.ImageIndex = 1;
//
// imageList
//
this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this.imageList.ImageSize = new System.Drawing.Size(16, 16);
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.White;
//
// tabControl
//
this.tabControl.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabPage1,
this.tabPage2,
this.tabPage3});
this.tabControl.Location = new System.Drawing.Point(8, 40);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(632, 392);
this.tabControl.TabIndex = 1;
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.groupBoxLog,
this.groupBoxSettings,
this.groupBoxGraphics});
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(624, 366);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Page1";
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(624, 366);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Page2";
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(624, 366);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Page3";
//
// groupBoxGraphics
//
this.groupBoxGraphics.Controls.AddRange(new System.Windows.Forms.Control[] {
this.pictureBox});
this.groupBoxGraphics.Location = new System.Drawing.Point(8, 8);
this.groupBoxGraphics.Name = "groupBoxGraphics";
this.groupBoxGraphics.Size = new System.Drawing.Size(384, 248);
this.groupBoxGraphics.TabIndex = 0;
this.groupBoxGraphics.TabStop = false;
this.groupBoxGraphics.Text = "Graphics";
//
// pictureBox
//
this.pictureBox.Location = new System.Drawing.Point(8, 16);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(368, 224);
this.pictureBox.TabIndex = 0;
this.pictureBox.TabStop = false;
this.pictureBox.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox_Paint);
//
// groupBoxSettings
//
this.groupBoxSettings.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button2,
this.button1,
this.checkBox3,
this.checkBox2,
this.checkBox1,
this.radioButton3,
this.radioButton2,
this.radioButton1,
this.comboBox2,
this.comboBox1,
this.label5,
this.label4,
this.numericUpDown3,
this.numericUpDown2,
this.numericUpDown1,
this.label3,
this.label2,
this.label1});
this.groupBoxSettings.Location = new System.Drawing.Point(400, 8);
this.groupBoxSettings.Name = "groupBoxSettings";
this.groupBoxSettings.Size = new System.Drawing.Size(216, 248);
this.groupBoxSettings.TabIndex = 1;
this.groupBoxSettings.TabStop = false;
this.groupBoxSettings.Text = "Settings";
//
// groupBoxLog
//
this.groupBoxLog.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listBox});
this.groupBoxLog.Location = new System.Drawing.Point(8, 264);
this.groupBoxLog.Name = "groupBoxLog";
this.groupBoxLog.Size = new System.Drawing.Size(608, 96);
this.groupBoxLog.TabIndex = 2;
this.groupBoxLog.TabStop = false;
this.groupBoxLog.Text = "Log";
//
// listBox
//
this.listBox.Location = new System.Drawing.Point(8, 16);
this.listBox.Name = "listBox";
this.listBox.Size = new System.Drawing.Size(592, 69);
this.listBox.TabIndex = 0;
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(96, 16);
this.label1.TabIndex = 0;
this.label1.Text = "numericUpDown1";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(96, 16);
this.label2.TabIndex = 1;
this.label2.Text = "numericUpDown2";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(96, 16);
this.label3.TabIndex = 2;
this.label3.Text = "numericUpDown3";
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(112, 24);
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(96, 20);
this.numericUpDown1.TabIndex = 3;
this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
//
// numericUpDown2
//
this.numericUpDown2.Location = new System.Drawing.Point(112, 48);
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(96, 20);
this.numericUpDown2.TabIndex = 4;
this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
//
// numericUpDown3
//
this.numericUpDown3.Location = new System.Drawing.Point(112, 72);
this.numericUpDown3.Name = "numericUpDown3";
this.numericUpDown3.Size = new System.Drawing.Size(96, 20);
this.numericUpDown3.TabIndex = 5;
this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 96);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 16);
this.label4.TabIndex = 6;
this.label4.Text = "comboBox1";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 120);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(64, 16);
this.label5.TabIndex = 7;
this.label5.Text = "comboBox2";
//
// comboBox1
//
this.comboBox1.Items.AddRange(new object[] {
"Item0",
"Item1",
"Item2"});
this.comboBox1.Location = new System.Drawing.Point(112, 96);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(96, 21);
this.comboBox1.TabIndex = 8;
this.comboBox1.Text = "comboBox1";
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// comboBox2
//
this.comboBox2.Items.AddRange(new object[] {
"Item0",
"Item1",
"Item2"});
this.comboBox2.Location = new System.Drawing.Point(112, 120);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(96, 21);
this.comboBox2.TabIndex = 9;
this.comboBox2.Text = "comboBox2";
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
//
// radioButton1
//
this.radioButton1.Location = new System.Drawing.Point(8, 144);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(88, 24);
this.radioButton1.TabIndex = 10;
this.radioButton1.Text = "radioButton1";
this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click);
//
// radioButton2
//
this.radioButton2.Location = new System.Drawing.Point(8, 168);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(88, 24);
this.radioButton2.TabIndex = 11;
this.radioButton2.Text = "radioButton2";
this.radioButton2.Click += new System.EventHandler(this.radioButton2_Click);
//
// radioButton3
//
this.radioButton3.Location = new System.Drawing.Point(8, 192);
this.radioButton3.Name = "radioButton3";
this.radioButton3.Size = new System.Drawing.Size(88, 24);
this.radioButton3.TabIndex = 12;
this.radioButton3.Text = "radioButton3";
this.radioButton3.Click += new System.EventHandler(this.radioButton3_Click);
//
// checkBox1
//
this.checkBox1.Location = new System.Drawing.Point(120, 144);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(80, 24);
this.checkBox1.TabIndex = 13;
this.checkBox1.Text = "checkBox1";
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// checkBox2
//
this.checkBox2.Location = new System.Drawing.Point(120, 168);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(80, 24);
this.checkBox2.TabIndex = 14;
this.checkBox2.Text = "checkBox2";
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
//
// checkBox3
//
this.checkBox3.Location = new System.Drawing.Point(120, 192);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(80, 24);
this.checkBox3.TabIndex = 15;
this.checkBox3.Text = "checkBox3";
this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
//
// button1
//
this.button1.Location = new System.Drawing.Point(16, 216);
this.button1.Name = "button1";
this.button1.TabIndex = 16;
this.button1.Text = "Button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(120, 216);
this.button2.Name = "button2";
this.button2.TabIndex = 17;
this.button2.Text = "Button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(648, 441);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabControl,
this.toolBar});
this.Menu = this.mainMenu;
this.Name = "Form1";
this.Text = "DemoApp";
this.tabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBoxGraphics.ResumeLayout(false);
this.groupBoxSettings.ResumeLayout(false);
this.groupBoxLog.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
this.listBox.Items.Add("NumericUpDown1: " + this.numericUpDown1.Value.ToString());
}
private void numericUpDown2_ValueChanged(object sender, System.EventArgs e)
{
this.listBox.Items.Add("NumericUpDown2: " + this.numericUpDown2.Value.ToString());
}
private void numericUpDown3_ValueChanged(object sender, System.EventArgs e)
{
this.listBox.Items.Add("NumericUpDown3: " + this.numericUpDown3.Value.ToString());
}
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.listBox.Items.Add("ComboBox1: index " + comboBox1.SelectedIndex.ToString());
}
private void comboBox2_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.listBox.Items.Add("ComboBox2: index " + comboBox2.SelectedIndex.ToString());
}
private void pictureBox_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Pen blackPen = new Pen(Color.Black, 3);
Pen redPen = new Pen(Color.Red, 3);
Pen yellowPen = new Pen(Color.Green, 3);
e.Graphics.DrawLine(blackPen, 0.0f, 0.0f, 250.0f, 250.0f);
e.Graphics.DrawEllipse(redPen, 100.0f, 10.0f, 200.0f, 200.0f);
e.Graphics.DrawRectangle(yellowPen, 0.0f, 100.0f, 350.0f, 100.0f);
}
private void radioButton1_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("RadioButton: 1");
}
private void radioButton2_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("RadioButton: 2");
}
private void radioButton3_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("RadioButton: 3");
}
private void checkBox1_CheckedChanged(object sender, System.EventArgs e)
{
if(this.checkBox1.Checked)
{
this.listBox.Items.Add("CheckBox1: checked");
}
else
{
this.listBox.Items.Add("CheckBox1: unchecked");
}
}
private void checkBox2_CheckedChanged(object sender, System.EventArgs e)
{
if(this.checkBox2.Checked)
{
this.listBox.Items.Add("CheckBox2: checked");
}
else
{
this.listBox.Items.Add("CheckBox2: unchecked");
}
}
private void checkBox3_CheckedChanged(object sender, System.EventArgs e)
{
if(this.checkBox3.Checked)
{
this.listBox.Items.Add("CheckBox3: checked");
}
else
{
this.listBox.Items.Add("CheckBox3: unchecked");
}
}
private void button1_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("Button1: clicked");
}
private void button2_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("Button2: clicked");
}
private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
if(e.Button == toolBarButtonDemo1)
{
this.listBox.Items.Add("Toolbar: button 1");
}
else
{
if(e.Button == toolBarButtonDemo2)
{
this.listBox.Items.Add("Toolbar: button 2");
}
}
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("Menu: File->Exit clicked");
}
private void menuItem4_Click(object sender, System.EventArgs e)
{
this.listBox.Items.Add("Menu: Help->About clicked");
}
}
}