* ExampleBrowser.cs: Output TextBox now uses a monospace font.

* ExampleBrowser.Designer.cs: Worked around RichTextBox scrolling artifacts on Mono 1.9.2/2.0.
This commit is contained in:
the_fiddler 2009-04-21 13:06:50 +00:00
parent 25fda5ae19
commit f60715998a
2 changed files with 10 additions and 8 deletions

View file

@ -187,7 +187,7 @@
// //
// richTextBoxDescription // richTextBoxDescription
// //
this.richTextBoxDescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.richTextBoxDescription.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.richTextBoxDescription.ContextMenuStrip = this.contextMenuStripDescription; this.richTextBoxDescription.ContextMenuStrip = this.contextMenuStripDescription;
this.richTextBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBoxDescription.Location = new System.Drawing.Point(3, 3); this.richTextBoxDescription.Location = new System.Drawing.Point(3, 3);
@ -226,7 +226,7 @@
// richTextBoxSource // richTextBoxSource
// //
this.richTextBoxSource.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(242)))), ((int)(((byte)(240))))); this.richTextBoxSource.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(242)))), ((int)(((byte)(240)))));
this.richTextBoxSource.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.richTextBoxSource.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.richTextBoxSource.ContextMenuStrip = this.contextMenuStripSource; this.richTextBoxSource.ContextMenuStrip = this.contextMenuStripSource;
this.richTextBoxSource.Dock = System.Windows.Forms.DockStyle.Fill; this.richTextBoxSource.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBoxSource.Location = new System.Drawing.Point(3, 3); this.richTextBoxSource.Location = new System.Drawing.Point(3, 3);
@ -265,7 +265,7 @@
// textBoxOutput // textBoxOutput
// //
this.textBoxOutput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(242)))), ((int)(((byte)(240))))); this.textBoxOutput.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(242)))), ((int)(((byte)(240)))));
this.textBoxOutput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.textBoxOutput.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.textBoxOutput.ContextMenuStrip = this.contextMenuStripOutput; this.textBoxOutput.ContextMenuStrip = this.contextMenuStripOutput;
this.textBoxOutput.Dock = System.Windows.Forms.DockStyle.Fill; this.textBoxOutput.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBoxOutput.Location = new System.Drawing.Point(3, 3); this.textBoxOutput.Location = new System.Drawing.Point(3, 3);

View file

@ -24,15 +24,17 @@ namespace Examples
InitializeComponent(); InitializeComponent();
// Windows 6 (Vista) and higher come with Consolas, a high-quality monospace font. Use that or fallback to the generic // Windows 6 (Vista) and higher come with Consolas, a high-quality monospace font. Use that or fallback to
// monospace font on other systems. // the generic monospace font on other systems.
if (System.Environment.OSVersion.Platform == PlatformID.Win32NT && System.Environment.OSVersion.Version.Major >= 6) if (System.Environment.OSVersion.Platform == PlatformID.Win32NT &&
System.Environment.OSVersion.Version.Major >= 6)
{ {
richTextBoxSource.Font = new Font("Consolas", 10.0f, FontStyle.Regular); textBoxOutput.Font = richTextBoxSource.Font = new Font("Consolas", 10.0f, FontStyle.Regular);
} }
else else
{ {
richTextBoxSource.Font = new Font(FontFamily.GenericMonospace, 10.0f, FontStyle.Regular); textBoxOutput.Font = richTextBoxSource.Font =
new Font(FontFamily.GenericMonospace, 10.0f, FontStyle.Regular);
} }
} }