using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Dialog_Designer
{
/// <summary>
/// Summary description for SimpleDialogBox.
/// </summary>
public class SimpleDialogBox : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public SimpleDialogBox()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
//Could be done manually as follows
//this.Text = "Simple Dialog Box";
// standard dialgo box styles
//this.FormBorderStyle = FormBorderStyle.FixedDialog;
//this.ControlBox = false;
//this.MaximizeBox = false;
//this.MinimizeBox = false;
//this.ShowInTaskbar = false;
this.Icon = new Icon("info.ico"); // but the icon file would have to be in the debug directory
}
/// <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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SimpleDialogBox));
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(40, 192);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "OK";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(168, 192);
this.button2.Name = "button2";
this.button2.TabIndex = 1;
this.button2.Text = "Cancel";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// SimpleDialogBox
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button2,
this.button1});
//this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SimpleDialogBox";
this.ShowInTaskbar = false;
this.Text = "Simple Dialog Box";
this.ResumeLayout(false);
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
DialogResult = DialogResult.OK;
}
private void button2_Click(object sender, System.EventArgs e)
{
DialogResult = DialogResult.Cancel;
}
}
}