Thread: text issues

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    99

    text issues

    hi, could anyone advise me on how to change the text color? i thought it would be straight forward but i have a listview created in borland c++ and i would like to programtically change so of the entries to a different font colour but i just cnt find out how to do it
    ive been scowering the borland help file for clues but im just not getting anywhere

    any help would be appreciated

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Sure But I know the answer isn't going to be as pretty as you were hoping.

    Example:
    Code:
    #include <windows.h>
    #include <iostream>
    
    unsigned long setcolor(unsigned long color, unsigned short x=0, unsigned short y=0, unsigned long length=65535)
    {
      static HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE);
      DWORD attribs = (DWORD)INVALID_HANDLE;
    
      if(stdOut)
        WriteConsoleOutputAttribute(handle, color, COORD(x, y), &attribs);
    
      return attribs;
    }

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    thank you for your reply and u were very much right, that is nothing like i thought it was going to be! If im honest im totally baffled as to what that is and unfortunatly I havnt been able to make it work in my program I just get a lot of errors

    as an example I have put in one item from my list view. If I was going to change the word hello in my listview to font colour read on my GUI Im not sure how to impliment ur code example?

    Code:
      ListIt2 = ListView2->Items->Add();
    
        ListIt2->SubItems->Add("hello");
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My text doesn't display
    By joeprogrammer in forum Game Programming
    Replies: 11
    Last Post: 02-23-2006, 10:01 PM
  2. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 12:35 AM
  3. Issues reading text files
    By ozzy34 in forum C++ Programming
    Replies: 5
    Last Post: 06-01-2004, 08:15 AM
  4. Structure problem
    By mattz in forum C Programming
    Replies: 10
    Last Post: 11-30-2001, 01:19 PM