private void MainForm_Shown(object sender, EventArgs e) { FormFontFixer.Fix(this); //Convert the horizontal line label to a real line by chaning it's size to 2 labelHorizontalLine.Text = ""; labelHorizontalLine.Height = 2; //Position it directly below the menu strip Point location = labelHorizontalLine.Location; location.Y = menuStrip.Size.Height; }
private void MonospacedTextForm_Shown(object sender, EventArgs e) { FormFontFixer.Fix(this); if (string.IsNullOrWhiteSpace(Title) == false) { this.Text = Title; } richTextBox.Text = "No content provided"; //Set richtextbox to monospaced font. +1 to make it a little bigger //We need to do this BEFORE we add content or we need to work with .SelectAll(), .SelectFont= etc. richTextBox.Font = new Font(FontFamily.GenericMonospace, richTextBox.Font.Size + 1); if (string.IsNullOrWhiteSpace(Content) == false) { richTextBox.Text = Content; } //Debug information to display currently used font //MessageBox.Show(richTextBox.Font.ToString()); }