7 Replies - 136192 Views - Last Post: 13 October 2007 - 06:01 AM Rate Topic: -----

#1 henry  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 96
  • Joined: 03-January 06

How to change color in C++ background?

Post icon  Posted 09 March 2006 - 04:54 AM

How to change color in C++ background?

I want my C++ program become interesting
How can I change the color of background and color of font even size of font.........


I will always use
system("cls")
to clear there screen.....

so I want do C++ DOS into something we call presentation like powerpoint
Haha........

Any tutorial?
That all
Thank you
Is This A Good Question/Topic? 0
  • +

Replies To: How to change color in C++ background?

#2 Potter  Icon User is offline

  • Phish Schlapper
  • member icon

Reputation: 3
  • View blog
  • Posts: 641
  • Joined: 20-June 03

Re: How to change color in C++ background?

Posted 09 March 2006 - 10:19 AM

If you look at help color in the command prompt (I'm assuming you're using windows), it shows the color command and values. You can use it with the system line, much like system("cls")
Was This Post Helpful? 0
  • +
  • -

#3 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: How to change color in C++ background?

Posted 09 March 2006 - 02:20 PM

http://faq.cprogramm...7&id=1043284392

That shows how to manipulate the colors of the console window pretty well.
Was This Post Helpful? 1
  • +
  • -

#4 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: How to change color in C++ background?

Posted 09 March 2006 - 11:14 PM

great link.
A combination of textattr(),textbackground(),textcolor() will let you do a lot with colours.
Was This Post Helpful? 0
  • +
  • -

#5 tot2ivn  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-December 05

Re: How to change color in C++ background?

Posted 10 March 2006 - 05:50 AM

Thanks Mrafcho001 !!!
The link is awesome .,.. ;)
Was This Post Helpful? 0
  • +
  • -

#6 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: How to change color in C++ background?

Posted 10 March 2006 - 12:19 PM

remember conio.h only works on windows
Was This Post Helpful? 0
  • +
  • -

#7 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: How to change color in C++ background?

Posted 11 March 2006 - 06:48 AM

yup....but he wants it for Windows/DOS only. good 4 him.
Was This Post Helpful? 0
  • +
  • -

#11 finaldestiny_016  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 10
  • Joined: 13-October 07

Re: How to change color in C++ background?

Posted 13 October 2007 - 06:01 AM

hi henry regarding to your problem on how to change the textbackground color and text is simple like this.
#include<iostream.h>
#include<conio.h>
#include<dos.h>
main()
{
	textbackgroundcolor(BLUE);
	textcolor(YELLOW);
	
	 clrscr();
	 cout<<"/n/n/t/t/t HENRY";
	 
	  getch();
	  return 0;
}



- -> if you want to make your text to blink. just add to the code which is textcolor(YELLOW+BLINK);

ok? just try..

*edit: next time please use code tags - 1lacca
Was This Post Helpful? 1

Page 1 of 1