You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2025. It is now read-only.
Hi Bro. When I used your source, I found an error in the function fontToolStripMenuItem_Click(),fontToolStripMenuItem_Click,
When I press exit the form still opens a new form. How I fix errors:
private void fontToolStripMenuItem_Click(object sender, EventArgs e){
try
{
DialogResult result = fontDialog1.ShowDialog(); // show the Font Dialog
System.Drawing.Font oldFont = this.Font; // gets current font
if (result == DialogResult.OK)
{
fontDialog1_Apply(richTextBox1, new System.EventArgs());
}
// set back to the recent font
else if (result == DialogResult.Cancel)
{
// set current font back to the old font
this.Font = oldFont;
// sets the old font for the controls inside richTextBox1
foreach (Control containedControl in richTextBox1.Controls)
{
containedControl.Font = oldFont;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); // error
}
}
private void fontToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
DialogResult result = fontDialog1.ShowDialog(); // show the Font Dialog
System.Drawing.Font oldFont = this.Font; // gets current font
if (result == DialogResult.OK)
{
fontDialog1_Apply(richTextBox1, new System.EventArgs());
}
// set back to the recent font
else if (result == DialogResult.Cancel)
{
// set current font back to the old font
this.Font = oldFont;
// sets the old font for the controls inside richTextBox1
foreach (Control containedControl in richTextBox1.Controls)
{
containedControl.Font = oldFont;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error Information", MessageBoxButtons.OK, MessageBoxIcon.Warning); // error
}
}
Hi Bro. When I used your source, I found an error in the function fontToolStripMenuItem_Click(),fontToolStripMenuItem_Click,
When I press exit the form still opens a new form. How I fix errors: