Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have built a neat little Console app which basically interacts with ASP.NET projects on a users machine. I have a really trivial need, all I need to do is before I show the Console window, I need to have it a black background, a lime green foreground and a Lucida font. I could achieve the color part by using the static methods of Console class. Although there is nothing in the class which talks about changing fonts? Has anyone been able to change Console font programatically?

Any help appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
143 views
Welcome To Ask or Share your Answers For Others

1 Answer

Please don't do that on an application that is meant to be used from other users, unless they request this feature. Consolas is the only font for consoles on my system :p

You can try to change the properties of the link that opens the console (or the executable), but that is a local setting if I'm right. This is likely the thing you want if it's just for running the app on your system. I'm not sure how you can change these programmatically.

Since Vista, there's SetCurrentConsoleFontEx, which may do what you want, if you can get it to work with the Console class. Did I mention I will hate you for that if the app ever comes to my system? ;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...