What is the C # equivalent for Label.FontName VB6?

Label VB6 controls have the FontName property, which allows you to set the font as follows: lblTitle.FontName = "Arial Bold" . Does C # have something like this?

I am transferring a heavy database program from VB6 to C #, and I get the names of fonts such as "Arial Bold" or "Garamond Italic" from the database, and I have to set the font of some labels based on this text from the database.

+4
source share
2 answers

Try to do this, for example:

 lblTitle.Font = new Font("Arial", 12, FontStyle.Bold); 

To set the font of the tag to Arial Bold. In this example, the font size is 12.

+4
source

You will need to create a new Font and install it in the constructor. then set the new font to the control.

+2
source

Source: https://habr.com/ru/post/1343177/


All Articles