using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace GroupBox_Panel
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox mainGroupBox;
private System.Windows.Forms.Button hiButton;
private System.Windows.Forms.Button byeButton;
private System.Windows.Forms.Panel mainPanel;
private System.Windows.Forms.Button leftButton;
private System.Windows.Forms.Button rightButton;
private System.Windows.Forms.Label messageLabel;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// 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 Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#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.mainGroupBox = new System.Windows.Forms.GroupBox();
this.hiButton = new System.Windows.Forms.Button();
this.byeButton = new System.Windows.Forms.Button();
this.mainPanel = new System.Windows.Forms.Panel();
this.leftButton = new System.Windows.Forms.Button();
this.rightButton = new System.Windows.Forms.Button();
this.messageLabel = new System.Windows.Forms.Label();
this.mainGroupBox.SuspendLayout();
this.mainPanel.SuspendLayout();
this.SuspendLayout();
//
// mainGroupBox
//
this.mainGroupBox.Controls.AddRange(new System.Windows.Forms.Control[] {
this.byeButton,
this.hiButton});
this.mainGroupBox.Location = new System.Drawing.Point(16, 32);
this.mainGroupBox.Name = "mainGroupBox";
this.mainGroupBox.TabIndex = 0;
this.mainGroupBox.TabStop = false;
this.mainGroupBox.Text = "Main GroupBox";
//
// hiButton
//
this.hiButton.Location = new System.Drawing.Point(24, 40);
this.hiButton.Name = "hiButton";
this.hiButton.Size = new System.Drawing.Size(56, 24);
this.hiButton.TabIndex = 0;
this.hiButton.Text = "Hi";
this.hiButton.Click += new System.EventHandler(this.hiButton_Click);
//
// byeButton
//
this.byeButton.Location = new System.Drawing.Point(112, 40);
this.byeButton.Name = "byeButton";
this.byeButton.Size = new System.Drawing.Size(64, 23);
this.byeButton.TabIndex = 1;
this.byeButton.Text = "Bye";
this.byeButton.Click += new System.EventHandler(this.byeButton_Click);
//
// mainPanel
//
this.mainPanel.AutoScroll = true;
this.mainPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.mainPanel.Controls.AddRange(new System.Windows.Forms.Control[] {
this.rightButton,
this.leftButton});
this.mainPanel.Location = new System.Drawing.Point(48, 176);
this.mainPanel.Name = "mainPanel";
this.mainPanel.Size = new System.Drawing.Size(112, 104);
this.mainPanel.TabIndex = 1;
//
// leftButton
//
this.leftButton.Location = new System.Drawing.Point(18, 40);
this.leftButton.Name = "leftButton";
this.leftButton.TabIndex = 0;
this.leftButton.Text = "Far Left";
this.leftButton.Click += new System.EventHandler(this.leftButton_Click);
//
// rightButton
//
this.rightButton.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rightButton.Location = new System.Drawing.Point(154, 40);
this.rightButton.Name = "rightButton";
this.rightButton.TabIndex = 1;
this.rightButton.Text = "Far Right";
this.rightButton.Click += new System.EventHandler(this.rightButton_Click);
//
// messageLabel
//
this.messageLabel.Location = new System.Drawing.Point(16, 152);
this.messageLabel.Name = "messageLabel";
this.messageLabel.Size = new System.Drawing.Size(200, 23);
this.messageLabel.TabIndex = 2;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(384, 325);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.messageLabel,
this.mainPanel,
this.mainGroupBox});
this.Name = "Form1";
this.Text = "Groupbox and Panel";
this.mainGroupBox.ResumeLayout(false);
this.mainPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void hiButton_Click(object sender, System.EventArgs e)
{
messageLabel.Text = "Hi pressed";
}
private void byeButton_Click(object sender, System.EventArgs e)
{
messageLabel.Text = "Bye pressed";
}
private void leftButton_Click(object sender, System.EventArgs e)
{
messageLabel.Text = "Far Left pressed";
}
private void rightButton_Click(object sender, System.EventArgs e)
{
messageLabel.Text = "Far Right pressed";
}
}
}