Thread: Colors

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    206

    Colors

    How do i change font color for dos??

  2. #2
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    it has been asked 1000000 of times
    do a search for specifics

    hint - conio.h, textcolor ,etc
    -

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    conio.h doesnt support textcolor.h and textcolor doesnt show up in help

  4. #4
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    textcolor is a function not a header.

    what compiler are you using
    -

  5. #5
    Registered User Sekti's Avatar
    Join Date
    Feb 2002
    Posts
    163

    ok

    do this
    Code:
    #include <iostream.h>
    #include <conio.h> //Needed to change colors
    
    int main()
    {
         textcolor(WHITE); 
         textbackground(BLUE);
       clrscr();
       cout<<"Hello"<<endl;
    return 0;
    }
    that will make the background of the dos screen blue and the words white. Look in conio.h for a listing of colors. Colors have to be in all caps. You have to clrscr() everytime you change the colors.
    +++
    ++
    + Sekti
    ++
    +++

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Didn't I read somewhere that you use MSVC++ Denethor? If so then you don't have textcolor in your conio.h. Of course, I may just be crazy.

    -Prelude
    My best code is written with the delete key.

  7. #7
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    yes, and no.(and maybe yes hehe)

    yes : i have MSVC++ 4.0

    Yes: I have conio.h, but it doesnt have text commands

    Maybe : You're crazy

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why I only get 8 colors out of ncurses?
    By Nazgulled in forum C Programming
    Replies: 3
    Last Post: 05-08-2007, 06:06 PM
  2. Relation between material colors and light colors.
    By indigo0086 in forum Game Programming
    Replies: 3
    Last Post: 04-18-2007, 03:20 PM
  3. colors in forefox and colors in IE
    By MisterSako in forum Tech Board
    Replies: 3
    Last Post: 05-15-2006, 01:59 PM
  4. colors?
    By planet_abhi in forum Game Programming
    Replies: 1
    Last Post: 09-10-2003, 05:37 PM
  5. Text Colors
    By GaPe in forum C Programming
    Replies: 1
    Last Post: 07-11-2002, 06:57 AM