Peter Kiers
asked on
Saving fontname and fontsize to the settings-file.
Dear Experts,
I have a fontDialog1 on my form that can be called by pressing on a button.
The user than can choose his/her favorite fontname and fontsize.
What I would like is to save the fontname and size to the settings-file
when the OK-button of the fontdialog1 is pressed.
How can I do that?
private void btnLetType_Click(object sender, EventArgs e)
{
if (fontDialog1.ShowDialog() == DialogResult.OK)
{
//
}
}
peter
I have a fontDialog1 on my form that can be called by pressing on a button.
The user than can choose his/her favorite fontname and fontsize.
What I would like is to save the fontname and size to the settings-file
when the OK-button of the fontdialog1 is pressed.
How can I do that?
private void btnLetType_Click(object sender, EventArgs e)
{
if (fontDialog1.ShowDialog() == DialogResult.OK)
{
//
}
}
peter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How is this question different than your previous question?
ASKER
I have this:
private void button1_Click(object sender, EventArgs e)
{
Properties.Settings.Defaul t.MyFont = fontDialog1.Font;
Properties.Settings.Defaul t.Save();
}
//*----------------------- ---------- ---------- ---------- ------*//
private void Settings_Load(object sender, EventArgs e)
{
fontDialog1.Font = Properties.Settings.Defaul t.MyFont;
}
//*----------------------- ---------- ---------- ---------- ------*//
and it works. Thank you.
Peter
private void button1_Click(object sender, EventArgs e)
{
Properties.Settings.Defaul
Properties.Settings.Defaul
}
//*-----------------------
private void Settings_Load(object sender, EventArgs e)
{
fontDialog1.Font = Properties.Settings.Defaul
}
//*-----------------------
and it works. Thank you.
Peter
Csharp:
Properties.Settings.Defaul t.MyFont = fontDialog1.Font;
Properties.Settings.Defaul t.Save();
Properties.Settings.Defaul
Properties.Settings.Defaul