-
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
-
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;
}
-
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