© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
Petr

❔ Unable to change font in VS 2019

Hello, i have persisting problem in my c# project made in VS 2019. I made a custom class that is supposed to change font to any font available to my console:(FontChangerClass file added as an attachment). But it doesn't work. I use additional code to check for errors that is based on the FontManager class (attachment) and that looks like this:

static void Main(string[] args)
        {


            bool success = FontManager.SetFont("MS Gothic", 16, 12);

            if (success)
            {
                Console.WriteLine("Font successfully set.");
            }
            else
            {
                Console.WriteLine("Failed to set font.");
            }
            Thread.Sleep(2500);
            FontManager.PrintStdHandles();
            Thread.Sleep(3000);
static void Main(string[] args)
        {


            bool success = FontManager.SetFont("MS Gothic", 16, 12);

            if (success)
            {
                Console.WriteLine("Font successfully set.");
            }
            else
            {
                Console.WriteLine("Failed to set font.");
            }
            Thread.Sleep(2500);
            FontManager.PrintStdHandles();
            Thread.Sleep(3000);

My handles are standard -> Input = 8, Output = 12, Error = 16. But even if i enter all the information correctly, it still doesn't change the font and returns an Error: 87.

My default console font is Consolas, 16 and i'm trying to change it to MS Gothic, 16. Only temporarily, otherwise i would do it through console properties setting.

And i am aware that font changing is resolved much better in VS 2022, but i am unable install 2022 because it throws an installation error about NET 4.8 package while downloading. Thanks for taking the time to check out my code,
Petr
FontChangerClass.txt3.19KB
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Primary constructors in VS 2019.
C#CC# / help
3y ago
✅ how open winforms vs 2019
C#CC# / help
2y ago