text color and font
-
hello ppl, i am making a very simple program that is a window application. pretty much a basic hello world program to just get myself started and i have the program set up. its written in c++ and compiled with visual basic 6.0 my question is how do you pick text colors and font size? i also have a couple console programs (they open with a dos command prompt) and i would like to know how to do it in those as well. its been making me insane cause its taking so long to find something as simple as the code to change text color. mabie i would even like to add a next page to it so u can toggle pages, but i want to take it one thing at a time and try and figure this color thing out first. i would appreciate any help or advise, thank you.
-
hello ppl, i am making a very simple program that is a window application. pretty much a basic hello world program to just get myself started and i have the program set up. its written in c++ and compiled with visual basic 6.0 my question is how do you pick text colors and font size? i also have a couple console programs (they open with a dos command prompt) and i would like to know how to do it in those as well. its been making me insane cause its taking so long to find something as simple as the code to change text color. mabie i would even like to add a next page to it so u can toggle pages, but i want to take it one thing at a time and try and figure this color thing out first. i would appreciate any help or advise, thank you.
How did you write it in C++ and compile it in visual basic? Visual Basic allows you to change the color by setting the window/form object property...if I remember correctly...it's something like
forecolor
andbackcolor
if you want to do it dynamically at run time. Or you can play with the properties though the properties dialog box. In C++ assuming your using MFC or SDK it's a little different...there is no way to cheat and use a properties dialog box, you have to code it like the first example I gave you in visual basic.pDC->SetTextColor(RGB(64,128,255)); if your using MFC or
SetTextColor(hdc, RGB(64,128,255)); if your using SDKAs far as setting text colors at the DOS console...thats totally different. I believe in c, you had to use a library like borlands BGI library..in QBasic...I believe it was the
COLOR
statement. This should atleast give you a starting point to work from so long as I understand you correctly anyways... :) Cheers :) I'm drinking triples, seeing double and acting single :cool: -
How did you write it in C++ and compile it in visual basic? Visual Basic allows you to change the color by setting the window/form object property...if I remember correctly...it's something like
forecolor
andbackcolor
if you want to do it dynamically at run time. Or you can play with the properties though the properties dialog box. In C++ assuming your using MFC or SDK it's a little different...there is no way to cheat and use a properties dialog box, you have to code it like the first example I gave you in visual basic.pDC->SetTextColor(RGB(64,128,255)); if your using MFC or
SetTextColor(hdc, RGB(64,128,255)); if your using SDKAs far as setting text colors at the DOS console...thats totally different. I believe in c, you had to use a library like borlands BGI library..in QBasic...I believe it was the
COLOR
statement. This should atleast give you a starting point to work from so long as I understand you correctly anyways... :) Cheers :) I'm drinking triples, seeing double and acting single :cool:Hockey wrote: How did you write it in C++ and compile it in visual basic? That's what I was wondering too, but actually, I think he means in Visual Studio. :~
**"To know what is right and not do it is the worst cowardice." -- Confucius
-
How did you write it in C++ and compile it in visual basic? Visual Basic allows you to change the color by setting the window/form object property...if I remember correctly...it's something like
forecolor
andbackcolor
if you want to do it dynamically at run time. Or you can play with the properties though the properties dialog box. In C++ assuming your using MFC or SDK it's a little different...there is no way to cheat and use a properties dialog box, you have to code it like the first example I gave you in visual basic.pDC->SetTextColor(RGB(64,128,255)); if your using MFC or
SetTextColor(hdc, RGB(64,128,255)); if your using SDKAs far as setting text colors at the DOS console...thats totally different. I believe in c, you had to use a library like borlands BGI library..in QBasic...I believe it was the
COLOR
statement. This should atleast give you a starting point to work from so long as I understand you correctly anyways... :) Cheers :) I'm drinking triples, seeing double and acting single :cool:hi, thank you for your seggustions i will try the out when i get the chance. i think i did mean visual studio... its the program called microsoft visual c++ 6.0. sorry about the mixups im a coding newbie. (n00b alert) i have edited lots of good code but never really come up with my own program from scratch. I customized quake2.exe to have all kinds of new features, graphics and commands. i made my own mod for quake2 also (thats gamex86.dll). i pretty much did it all with no help or prior experience but now i want to attempt something simple as making my own little program and its a lot harder then i would have imagined. thanks again
-
How did you write it in C++ and compile it in visual basic? Visual Basic allows you to change the color by setting the window/form object property...if I remember correctly...it's something like
forecolor
andbackcolor
if you want to do it dynamically at run time. Or you can play with the properties though the properties dialog box. In C++ assuming your using MFC or SDK it's a little different...there is no way to cheat and use a properties dialog box, you have to code it like the first example I gave you in visual basic.pDC->SetTextColor(RGB(64,128,255)); if your using MFC or
SetTextColor(hdc, RGB(64,128,255)); if your using SDKAs far as setting text colors at the DOS console...thats totally different. I believe in c, you had to use a library like borlands BGI library..in QBasic...I believe it was the
COLOR
statement. This should atleast give you a starting point to work from so long as I understand you correctly anyways... :) Cheers :) I'm drinking triples, seeing double and acting single :cool:hockey, i tried the code you gave me and it worked! thanks a lot man i really appreciate that. the line i entered was..
SetTextColor(hdc, RGB(64,128,255));
theres one thing i was wondering about... theres a white highlight to just the text, i changed the backround and text color but there is still a white backround to the text. im going to try and see if i can switch that color too thanks again. -
hockey, i tried the code you gave me and it worked! thanks a lot man i really appreciate that. the line i entered was..
SetTextColor(hdc, RGB(64,128,255));
theres one thing i was wondering about... theres a white highlight to just the text, i changed the backround and text color but there is still a white backround to the text. im going to try and see if i can switch that color too thanks again.SetBkMode(TRANSPARENT)
I'm drinking triples, seeing double and acting single :cool: -
SetBkMode(TRANSPARENT)
I'm drinking triples, seeing double and acting single :cool:eheh got it, i think my line was setbkcolor. i just searched the include files for the settextcolor line, and saw it right above. the program is set to draw one string. i tried to add another and i cant get it to draw the second one. i was thinking about having it show one little page of info. Then going through the menu or other button and having it display another string of info, kind of like a bunch of pages. any idea on how to do something like that? another thing that would be a cool addition would be a image added to the backround. i saw a ton of functions for the images in the include files and it would be a prayer if i actually found the right function for this. im gonna keep messing with it though and learn as i go. -later