How to set button font in Marlett

I am trying to install a button font in a Marlett system font. However, although I manually set the font, a different font is used. Also, Marlett is not specified when I use the font dialog to select a font for this button.

Why is that? What can I do to use the Marlett font in .NET Windows Forms elements?

+5
source share
3 answers

Although I don’t know what code is behind the designer, I have always found that the designer doesn’t display non-standard installed fonts . The good news is that the property Fontis ambient, so if you want all the controls to be the same Font, you had toset it to Form. However, it seems that you just want one control to have one Font, so let's do the following:

ctrl.Font = new Font("Marlett", 8.5f);

which sets the Fontvalue Marlettand size for this control 8.5.

, Font, , , Panel, Font Panel; .

+6
   button1.Font = new Font("Marlett",8, FontStyle.Regular);

Button1, ( constrcutor iinitializecomponet Load event)

+4

, GdiCharSet 0. , Marlett .

GdiCharSet 1, .

Also note the changes made to .designer.cs, this will also explain why this worked when you manually install the font from the code.

0
source

All Articles