using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace Simulation { /// /// Dialog that displays usage information from the file "about.rtf" in a RichTextBox. /// This class was created using Visual Studio Designer to layout the RichTextBox /// and the Button. /// public class About : Form { /// RichTextBox that displays the file "about.rtf" /// private RichTextBox richTextBox; /// Ok button to close about dialog. /// private Button button; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; /// /// Construct the about dialog object and load the contents of richTextBox from /// the file "about.rtf" in the project's main directory. /// public About() { // // Required for Windows Form Designer support // InitializeComponent(); // For mono or other development environments you need to set the // path for where file "about.rtf" is stored. richTextBox.LoadFile("..\\..\\about.rtf", RichTextBoxStreamType.RichText); } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #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.richTextBox = new System.Windows.Forms.RichTextBox(); this.button = new System.Windows.Forms.Button(); this.SuspendLayout(); // // richTextBox // this.richTextBox.Location = new System.Drawing.Point(0, 0); this.richTextBox.Name = "richTextBox"; this.richTextBox.ReadOnly = true; this.richTextBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; this.richTextBox.Size = new System.Drawing.Size(450, 225); this.richTextBox.TabIndex = 0; this.richTextBox.Text = ""; // // button // this.button.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.button.Location = new System.Drawing.Point(192, 240); this.button.Name = "button"; this.button.TabIndex = 1; this.button.Text = "OK"; this.button.Click += new System.EventHandler(this.button_Click); // // About // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(450, 279); this.ControlBox = false; this.Controls.Add(this.button); this.Controls.Add(this.richTextBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "About"; this.Text = "About Simulation"; this.ResumeLayout(false); } #endregion /// /// Handle the button click to close the about dialog. /// /// Ok button /// EventArgs private void button_Click(object sender, System.EventArgs e) { Hide(); } } }