Jump to content
  • Advertisement
Sign in to follow this  
cNoob

Edit Box

This topic is 4744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im making my own little notepad and im having problem with changing the font of my edit box i can change font and use textout but when i try use my font in an edit box it doesnt work. please help and how would i change font colour for the edit box thanx in advanced

Share this post


Link to post
Share on other sites
Advertisement
I have not played with the font option before, but changing the text color is as easy as inserting the following in your dialog box's callback:

static HDC hdc;

case WM_INITDIALOG:
{
hdc = GetDC(hwnd);
...
}
...
case WM_CTLCOLOREDIT:
{
SetTextColor((HDC)wparam, RGB(80, 80, 255));
//SetBkMode((HDC)wparam, OPAQUE);
//SetBkColor((HDC)wparam, RGB(0, 0, 0));
//return (INT_PTR)hbBackground;
}
break;
...



The parameters of RGB are currently set, for my program, to have the text in the color of light-blue. Make sure to release your resources before destroying the dialog box.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!