C
C#14mo ago
dvnlx.dev

How do i convert a string to System.Drawing.Font

I'm trying to make a notes app
2 Replies
dvnlx.dev
dvnlx.dev14mo ago
private void fontButton_Click(object sender, EventArgs e)
{
fontDialog.ShowColor = true;

fontDialog.Font = textBox.Font;
fontDialog.Font = ERROR -> defaultFont;
fontDialog.Color = textBox.ForeColor;
if (fontDialog.ShowDialog() != DialogResult.Cancel)
{
textBox.Font = fontDialog.Font;
textBox.ForeColor = fontDialog.Color;
}
}
private void fontButton_Click(object sender, EventArgs e)
{
fontDialog.ShowColor = true;

fontDialog.Font = textBox.Font;
fontDialog.Font = ERROR -> defaultFont;
fontDialog.Color = textBox.ForeColor;
if (fontDialog.ShowDialog() != DialogResult.Cancel)
{
textBox.Font = fontDialog.Font;
textBox.ForeColor = fontDialog.Color;
}
}
here is the code for more context