The best magazine
How to Set the Font to Arial in C#
- 1). Open the programming shell that you use to write your C# programs.
- 2). Open the C# program file in which you wish to implement the Arial font.
- 3). Type the following line of code in the main body of your program:
Font a = new Font("Arial", 16, FontStyle.Regular);
The code will define the font "a" as Arial with a font size of 16. If you want to change the font to a different size, simply input a size other than 16. If you want to change the font style, you can set it FontStyle.Bold, FontStyle.Italics, or FontStyle.Underline. - 4). Specify the font as "a" within any output command within your program in which you want the output text to be displayed in Arial.
For instance, to display the text "Hello World" in Arial font, you would type the line:
Console.Writeline(a, "Hello World");
Source: ...