|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace CardfileCE
{
/// <summary>
/// Summary description for frmProps.
/// </summary>
public class frmProps : System.Windows.Forms.Form
{
private PropType _props = null;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tbName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox tbAuthor;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button cmdOK;
private System.Windows.Forms.Button cmdCancel;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.TextBox tbComments;
public frmProps()
{
//
// 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 )
{
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.label1 = new System.Windows.Forms.Label();
this.tbName = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.tbAuthor = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.tbComments = new System.Windows.Forms.TextBox();
this.cmdOK = new System.Windows.Forms.Button();
this.cmdCancel = new System.Windows.Forms.Button();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Text = "Deck name:";
//
// tbName
//
this.tbName.Location = new System.Drawing.Point(104, 8);
this.tbName.Size = new System.Drawing.Size(128, 26);
this.tbName.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 40);
this.label2.Text = "Author:";
//
// tbAuthor
//
this.tbAuthor.Location = new System.Drawing.Point(104, 40);
this.tbAuthor.Size = new System.Drawing.Size(128, 26);
this.tbAuthor.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 72);
this.label3.Text = "Comments:";
//
// tbComments
//
this.tbComments.Location = new System.Drawing.Point(8, 96);
this.tbComments.Multiline = true;
this.tbComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbComments.Size = new System.Drawing.Size(224, 136);
this.tbComments.Text = "";
//
// cmdOK
//
this.cmdOK.Location = new System.Drawing.Point(160, 240);
this.cmdOK.Text = "&OK";
this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
//
// cmdCancel
//
this.cmdCancel.Location = new System.Drawing.Point(80, 240);
this.cmdCancel.Text = "&Cancel";
this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
//
// frmProps
//
this.Controls.Add(this.cmdCancel);
this.Controls.Add(this.cmdOK);
this.Controls.Add(this.tbComments);
this.Controls.Add(this.label3);
this.Controls.Add(this.tbAuthor);
this.Controls.Add(this.label2);
this.Controls.Add(this.tbName);
this.Controls.Add(this.label1);
this.Menu = this.mainMenu1;
this.Text = "Properties";
}
#endregion
public PropType Props
{
get
{
_props.Name = tbName.Text;
_props.Author = tbAuthor.Text;
_props.Comments = tbComments.Text;
return _props;
}
set
{
_props = value;
if ( _props != null )
{
tbName.Text = _props.Name;
tbAuthor.Text = _props.Author;
tbComments.Text = _props.Comments;
} // if
else
{
tbName.Text = "";
tbAuthor.Text = "";
tbComments.Text = "";
} // else
}
}
private void cmdOK_Click(object sender, System.EventArgs e)
{
// Just quit...
this.DialogResult = DialogResult.OK;
this.Close();
}
private void cmdCancel_Click(object sender, System.EventArgs e)
{
// Just quit...
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.