dvnlx.dev
dvnlx.dev
CC#
Created by dvnlx.dev on 5/29/2023 in #help
How do i convert a string to System.Drawing.Font
here is the code for more context
4 replies
CC#
Created by dvnlx.dev on 5/29/2023 in #help
How do i convert a string to System.Drawing.Font
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;
}
}
4 replies