Jump to content

How to change text color

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
teensicle

teensicle

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
Anyone knows how to change text colours?

#2
Moudi

Moudi

    Programmer

  • Members
  • PipPipPipPip
  • 167 posts
You can change the text color eathier by batch or graphics.h

#3
Bartimäus

Bartimäus

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts

teensicle said:

Anyone knows how to change text colours?
In which language ?
[SIGPIC][/SIGPIC]

#4
teensicle

teensicle

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
i only wanna change the color of one line of text.. to red

so for example
printf("[COLOR="Red"]PLEASE SELECT THE RIGHT OPTION[/COLOR]")


#5
teensicle

teensicle

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts

Bartimäus said:

In which language ?


in C....see above for example

#6
Bartimäus

Bartimäus

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 490 posts
I'm not a real c programmer but think you can change the color with that
 SetConsoleTextAttribute(hConsoleHandle,FOREGROUND_RED
It is from the msdn library
http//:msdn.microsoft.com/en-us/library/ms686047(VS.85).aspx#Mtps_DropDownFilterText
:)
[SIGPIC][/SIGPIC]

#7
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
C doesn't assume there are colors to change. There is no guarantee that printf displays to a color output device.

Also, please don't hijack threads. Create your own like this one.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog