hostile-takeover/m/EditRichTextForm.cs
2014-07-06 17:47:28 -07:00

127 lines
3.8 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace m
{
/// <summary>
/// Summary description for EditRichTextForm.
/// </summary>
public class EditRichTextForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button buttonOk;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button buttonCancel;
public System.Windows.Forms.TextBox textBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public EditRichTextForm(string strTitle, string strCurrent)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
textBox1.Text = strCurrent;
}
static public string DoModal(string strTitle, string strCurrent) {
EditRichTextForm frm = new EditRichTextForm(strTitle, strCurrent);
DialogResult res = frm.ShowDialog();
if (res == DialogResult.Cancel)
return null;
return frm.textBox1.Text;
}
/// <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.buttonOk = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.buttonCancel = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// buttonOk
//
this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOk.Location = new System.Drawing.Point(76, 234);
this.buttonOk.Name = "buttonOk";
this.buttonOk.TabIndex = 1;
this.buttonOk.Text = "Ok";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(200, 16);
this.label1.TabIndex = 4;
this.label1.Text = "Edit the text:";
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(188, 234);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.TabIndex = 2;
this.buttonCancel.Text = "Cancel";
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.textBox1.Location = new System.Drawing.Point(8, 24);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(320, 200);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "textBox1";
//
// EditRichTextForm
//
this.AcceptButton = this.buttonOk;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(338, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1,
this.buttonOk,
this.label1,
this.buttonCancel});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EditRichTextForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Text";
this.ResumeLayout(false);
}
#endregion
}
}