[c#] Easiest way to change font and font size

which is the easiest way to change Font size with C#.

with java it can all be done easily by calling Font constructor with necessary arguments.

JLabel lab  = new JLabel("Font Bold at 24");
lab.setFont(new Font("Serif", Font.BOLD, 24));

This question is related to c# winforms fonts

The answer is


Use this one to change only font size not the name of the font

label1.Font = new System.Drawing.Font(label1.Font.Name, 24F);

you can change that using label property in property panel. This screen shot is example that


Use the Font Class to set the control's font and styles.

Try Font Constructor (String, Single)

Label lab  = new Label();
lab.Text ="Font Bold at 24";
lab.Font = new Font("Arial", 20);

or

lab.Font = new Font(FontFamily.GenericSansSerif,
            12.0F, FontStyle.Bold);

To get installed fonts refer this - .NET System.Drawing.Font - Get Available Sizes and Styles


You can also create a varible and then assign it for a text. It is cool because you can assign it two or more texts.

To assign a variable do that

public partial class Sayfa1 : Form

   Font Normal = new Font("Segoe UI", 9, FontStyle.Bold);

    public Sayfa1()

This varible is not assigned to any text yet.To do it write the name of the text(Look proporties -> (Name)) then write ".Font" then call the name of your font variable.

lupusToolStripMenuItem.Font = Normal;

Now you have a text assigned to a Normal font. I hope I could be helpful.


This should do it (bold as well);

label1.Font = new Font("Serif", 24,FontStyle.Bold);

Examples related to c#

How can I convert this one line of ActionScript to C#? Microsoft Advertising SDK doesn't deliverer ads How to use a global array in C#? How to correctly write async method? C# - insert values from file into two arrays Uploading into folder in FTP? Are these methods thread safe? dotnet ef not found in .NET Core 3 HTTP Error 500.30 - ANCM In-Process Start Failure Best way to "push" into C# array

Examples related to winforms

How to set combobox default value? Get the cell value of a GridView row Getting the first and last day of a month, using a given DateTime object Check if a record exists in the database Delete a row in DataGridView Control in VB.NET How to make picturebox transparent? Set default format of datetimepicker as dd-MM-yyyy Changing datagridview cell color based on condition C# Inserting Data from a form into an access Database How to use ConfigurationManager

Examples related to fonts

How to import a new font into a project - Angular 5 Font Awesome 5 font-family issue How do I change the font color in an html table? How to add fonts to create-react-app based projects? Changing fonts in ggplot2 Webpack "OTS parsing error" loading fonts Failed to decode downloaded font Proper MIME type for .woff2 fonts Link a .css on another folder How can I fix the 'Missing Cross-Origin Resource Sharing (CORS) Response Header' webfont issue?