How To Change Background Color In C++
-
08-09-2007 #1
Registered User
- Join Date
- Aug 2007
- Posts
- 1
Irresolute the background color
Is it possible to alter the black color groundwork to a different colour?
If it is possible may sharing how to do it..cheers
-
08-09-2007 #2
l'Anziano
- Join Date
- Aug 2001
- Location
- Plano, Texas, United states of america
- Posts
- 2,743
well....that is very arrangement specific to be honest. There is not one standard way to do it.
Windows, Mac Os X, and Linux all take shells where you tin can physically change the background color options by selecting some kind of "preferences" menu (slightly varies depending on the Bone).
But I know that'due south not what you desire to know...you want to know how to do it in your program.
If you are using Windows/DOS: lots of older compilers came with a not-standard header file called dos.h that you could use to exercise some DOS specific stuff, including change the groundwork color I believe...merely well-nigh likely you lot won't have that file, and and then that probably won't piece of work.
Nigh probable you lot will have to employ some sort of system() command to be able to practise it...but I am not familiar with what the command would really be....
My Website
"Round logic is good because it is."
-
08-09-2007 #3
Registered User
- Join Date
- Sep 2005
- Location
- Cambridge, Britain
- Posts
- 1,732
Code:
#include <stdio.h> int main() { /* Some listing of combinations 0 = Black 1 = Blueish 2 = Green iii = Aqua iv = Red v = Majestic 6 = Yellow 7 = White 8 = Greyness 9 = Light Blue A = Light Greenish B = Light Aqua C = Light Red D = Light Regal E = Light Yellow F = Bright White */ printf("This is a console color change program\n"); system("COLOR F2"); /* This will change the bgcolor F - White and textcolor to 2- Dark-green */ getchar(); return 0; }
ssharish2005
-
08-09-2007 #4
Officially An Builder
- Join Engagement
- Mar 2007
- Location
- Portland, OR
- Posts
- 7,398
Originally Posted by ssharish2005
-
08-09-2007 #5
Registered User
- Join Date
- Oct 2001
- Posts
- 2,129
Originally Posted past brewbuck
-
08-09-2007 #6
Kernel hacker
- Join Engagement
- Jul 2007
- Location
- Farncombe, Surrey, England
- Posts
- fifteen,677
"DOS v.one.2600" looks suspiciously liek the version of Windows XP SP2 to me. My Win2K shows "5.0.2195" when I do "ver" in a command prompt. I'm pretty darn sure in that location wasn't a "five.1.2600" version of MS-DOS (or PC-DOS for that matter).
--
Mats
Source: https://cboard.cprogramming.com/c-programming/92512-changing-background-colour.html
Posted by: alvarezhourgen39.blogspot.com
0 Response to "How To Change Background Color In C++"
Post a Comment