using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Globalization;
using System.Threading;
using Utils.MessageBoxExLib;
namespace MessageBoxExDemo
{
///
///
///
public class MessageBoxExDemoForm : System.Windows.Forms.Form
{
#region Fields
private System.Windows.Forms.Button btnShowCustom;
private System.Windows.Forms.GroupBox grpBoxIcon;
private System.Windows.Forms.RadioButton radioButton4;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.ListView listViewButtons;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.TextBox txtMessage;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtCaption;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RadioButton radioButton5;
private System.Windows.Forms.TextBox txtSaveResponse;
private System.Windows.Forms.CheckBox chbAllowSaveResponse;
private System.Windows.Forms.TextBox txtResult;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ListView listViewMessageBoxes;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.Button btnAddMessageBox;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtButtonText;
private System.Windows.Forms.Label ButtonText;
private System.Windows.Forms.TextBox txtButtonVal;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.CheckBox chbIsCancel;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button btnAddButton;
private System.Windows.Forms.TextBox txtButtonHelp;
private System.Windows.Forms.CheckBox chbUseSavedResponse;
private System.Windows.Forms.CheckBox chbPlayAlert;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtTimeout;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.ComboBox cmbTimeoutResult;
private System.Windows.Forms.Button button1;
private System.ComponentModel.IContainer components;
#endregion
#region Ctor/Dtor
public MessageBoxExDemoForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#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.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Ok");
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Cancel");
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Yes");
System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("No");
System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("Abort");
System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("Retry");
System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Ignore");
this.btnShowCustom = new System.Windows.Forms.Button();
this.grpBoxIcon = new System.Windows.Forms.GroupBox();
this.radioButton5 = new System.Windows.Forms.RadioButton();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.listViewButtons = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.txtMessage = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtCaption = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.chbAllowSaveResponse = new System.Windows.Forms.CheckBox();
this.txtSaveResponse = new System.Windows.Forms.TextBox();
this.txtResult = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.listViewMessageBoxes = new System.Windows.Forms.ListView();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.btnAddMessageBox = new System.Windows.Forms.Button();
this.txtName = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtButtonHelp = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.chbIsCancel = new System.Windows.Forms.CheckBox();
this.txtButtonVal = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtButtonText = new System.Windows.Forms.TextBox();
this.ButtonText = new System.Windows.Forms.Label();
this.btnAddButton = new System.Windows.Forms.Button();
this.chbUseSavedResponse = new System.Windows.Forms.CheckBox();
this.chbPlayAlert = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.txtTimeout = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.cmbTimeoutResult = new System.Windows.Forms.ComboBox();
this.label9 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.grpBoxIcon.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// btnShowCustom
//
this.btnShowCustom.Location = new System.Drawing.Point(752, 328);
this.btnShowCustom.Name = "btnShowCustom";
this.btnShowCustom.Size = new System.Drawing.Size(160, 23);
this.btnShowCustom.TabIndex = 3;
this.btnShowCustom.Text = "Show Custom MessageBox";
this.toolTip1.SetToolTip(this.btnShowCustom, "Show the currently selected message box from the list");
this.btnShowCustom.Click += new System.EventHandler(this.btnShowCustom_Click);
//
// grpBoxIcon
//
this.grpBoxIcon.Controls.Add(this.radioButton5);
this.grpBoxIcon.Controls.Add(this.radioButton4);
this.grpBoxIcon.Controls.Add(this.radioButton3);
this.grpBoxIcon.Controls.Add(this.radioButton2);
this.grpBoxIcon.Controls.Add(this.radioButton1);
this.grpBoxIcon.Location = new System.Drawing.Point(448, 216);
this.grpBoxIcon.Name = "grpBoxIcon";
this.grpBoxIcon.Size = new System.Drawing.Size(136, 184);
this.grpBoxIcon.TabIndex = 15;
this.grpBoxIcon.TabStop = false;
this.grpBoxIcon.Text = "Icon";
//
// radioButton5
//
this.radioButton5.Location = new System.Drawing.Point(16, 152);
this.radioButton5.Name = "radioButton5";
this.radioButton5.TabIndex = 4;
this.radioButton5.Text = "None";
//
// radioButton4
//
this.radioButton4.Location = new System.Drawing.Point(16, 120);
this.radioButton4.Name = "radioButton4";
this.radioButton4.TabIndex = 2;
this.radioButton4.Text = "Question";
//
// radioButton3
//
this.radioButton3.Location = new System.Drawing.Point(16, 56);
this.radioButton3.Name = "radioButton3";
this.radioButton3.TabIndex = 1;
this.radioButton3.Text = "Exclamation";
//
// radioButton2
//
this.radioButton2.Location = new System.Drawing.Point(16, 88);
this.radioButton2.Name = "radioButton2";
this.radioButton2.TabIndex = 3;
this.radioButton2.Text = "Hand";
//
// radioButton1
//
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(16, 24);
this.radioButton1.Name = "radioButton1";
this.radioButton1.TabIndex = 0;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Asterisk";
//
// listViewButtons
//
this.listViewButtons.CheckBoxes = true;
this.listViewButtons.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1});
listViewItem1.StateImageIndex = 0;
listViewItem2.StateImageIndex = 0;
listViewItem3.StateImageIndex = 0;
listViewItem4.StateImageIndex = 0;
listViewItem5.StateImageIndex = 0;
listViewItem6.StateImageIndex = 0;
listViewItem7.StateImageIndex = 0;
this.listViewButtons.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1,
listViewItem2,
listViewItem3,
listViewItem4,
listViewItem5,
listViewItem6,
listViewItem7});
this.listViewButtons.Location = new System.Drawing.Point(296, 216);
this.listViewButtons.Name = "listViewButtons";
this.listViewButtons.Size = new System.Drawing.Size(136, 184);
this.listViewButtons.TabIndex = 14;
this.listViewButtons.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Buttons";
this.columnHeader1.Width = 130;
//
// txtMessage
//
this.txtMessage.Location = new System.Drawing.Point(72, 112);
this.txtMessage.Multiline = true;
this.txtMessage.Name = "txtMessage";
this.txtMessage.Size = new System.Drawing.Size(280, 80);
this.txtMessage.TabIndex = 5;
this.txtMessage.Text = "";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 112);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 17);
this.label2.TabIndex = 4;
this.label2.Text = "Message";
//
// txtCaption
//
this.txtCaption.Location = new System.Drawing.Point(72, 72);
this.txtCaption.Name = "txtCaption";
this.txtCaption.Size = new System.Drawing.Size(280, 21);
this.txtCaption.TabIndex = 3;
this.txtCaption.Text = "";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 72);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(42, 17);
this.label1.TabIndex = 2;
this.label1.Text = "Caption";
//
// chbAllowSaveResponse
//
this.chbAllowSaveResponse.Location = new System.Drawing.Point(80, 408);
this.chbAllowSaveResponse.Name = "chbAllowSaveResponse";
this.chbAllowSaveResponse.Size = new System.Drawing.Size(144, 24);
this.chbAllowSaveResponse.TabIndex = 16;
this.chbAllowSaveResponse.Text = "Allow Save Response";
//
// txtSaveResponse
//
this.txtSaveResponse.Location = new System.Drawing.Point(82, 432);
this.txtSaveResponse.Multiline = true;
this.txtSaveResponse.Name = "txtSaveResponse";
this.txtSaveResponse.Size = new System.Drawing.Size(272, 80);
this.txtSaveResponse.TabIndex = 17;
this.txtSaveResponse.Text = "";
//
// txtResult
//
this.txtResult.Location = new System.Drawing.Point(752, 512);
this.txtResult.Name = "txtResult";
this.txtResult.Size = new System.Drawing.Size(160, 21);
this.txtResult.TabIndex = 7;
this.txtResult.Text = "";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(712, 512);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 17);
this.label3.TabIndex = 6;
this.label3.Text = "Result";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// listViewMessageBoxes
//
this.listViewMessageBoxes.Activation = System.Windows.Forms.ItemActivation.TwoClick;
this.listViewMessageBoxes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader2});
this.listViewMessageBoxes.Location = new System.Drawing.Point(752, 96);
this.listViewMessageBoxes.MultiSelect = false;
this.listViewMessageBoxes.Name = "listViewMessageBoxes";
this.listViewMessageBoxes.Size = new System.Drawing.Size(192, 224);
this.listViewMessageBoxes.TabIndex = 2;
this.listViewMessageBoxes.View = System.Windows.Forms.View.Details;
this.listViewMessageBoxes.ItemActivate += new System.EventHandler(this.listViewMessageBoxes_ItemActivate);
//
// columnHeader2
//
this.columnHeader2.Text = "MessageBoxes";
this.columnHeader2.Width = 183;
//
// btnAddMessageBox
//
this.btnAddMessageBox.Location = new System.Drawing.Point(608, 192);
this.btnAddMessageBox.Name = "btnAddMessageBox";
this.btnAddMessageBox.Size = new System.Drawing.Size(128, 23);
this.btnAddMessageBox.TabIndex = 1;
this.btnAddMessageBox.Text = "Add MessageBox >>";
this.toolTip1.SetToolTip(this.btnAddMessageBox, "Create a message box with the specified information and add it to the list");
this.btnAddMessageBox.Click += new System.EventHandler(this.btnAddMessageBox_Click);
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(72, 32);
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(280, 21);
this.txtName.TabIndex = 1;
this.txtName.Text = "";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(24, 32);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(33, 17);
this.label4.TabIndex = 0;
this.label4.Text = "Name";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtButtonHelp);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.chbIsCancel);
this.groupBox1.Controls.Add(this.txtButtonVal);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.txtButtonText);
this.groupBox1.Controls.Add(this.ButtonText);
this.groupBox1.Controls.Add(this.grpBoxIcon);
this.groupBox1.Controls.Add(this.listViewButtons);
this.groupBox1.Controls.Add(this.txtMessage);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtCaption);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.chbAllowSaveResponse);
this.groupBox1.Controls.Add(this.txtSaveResponse);
this.groupBox1.Controls.Add(this.btnAddButton);
this.groupBox1.Controls.Add(this.txtName);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(592, 528);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "MessageBox";
//
// txtButtonHelp
//
this.txtButtonHelp.Location = new System.Drawing.Point(88, 280);
this.txtButtonHelp.Name = "txtButtonHelp";
this.txtButtonHelp.Size = new System.Drawing.Size(96, 21);
this.txtButtonHelp.TabIndex = 11;
this.txtButtonHelp.Text = "";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(16, 280);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(52, 17);
this.label6.TabIndex = 10;
this.label6.Text = "Help Text";
//
// chbIsCancel
//
this.chbIsCancel.Location = new System.Drawing.Point(88, 312);
this.chbIsCancel.Name = "chbIsCancel";
this.chbIsCancel.Size = new System.Drawing.Size(72, 24);
this.chbIsCancel.TabIndex = 12;
this.chbIsCancel.Text = "Is Cancel";
//
// txtButtonVal
//
this.txtButtonVal.Location = new System.Drawing.Point(88, 248);
this.txtButtonVal.Name = "txtButtonVal";
this.txtButtonVal.Size = new System.Drawing.Size(96, 21);
this.txtButtonVal.TabIndex = 9;
this.txtButtonVal.Text = "