Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting default fonts in C#

Tags:

c#

.net

I apologize if this question is listed elsewhere and I just didn't find it in my search. I am trying to find a way to set the DefaultFont property of a form so that users can select the font they want and it will be auto set every time the form opens. I already have the code to save to the user settings, I'm just looking for a way to set the Default Font property. I'm using Visual Studio 2005 with C#. Please let me know if there isn't enough info in here. Thanks!

like image 942
qat Avatar asked Oct 25 '25 08:10

qat


1 Answers

Basically, it is

private void Form1_Load(object sender, EventArgs e)
{
   this.Font = font_from_settings;
}

But it will be a little tricky to make sure no control is overriding it's own font property. You can use the designer to reset font-properties or delete them from *.Designer.cs

like image 108
Henk Holterman Avatar answered Oct 27 '25 20:10

Henk Holterman