Public Group

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.

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 on other sites
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 on other sites
Thanx it helped and ive nearly finished now

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
17
5. 5

• 9
• 12
• 9
• 33
• 13
• Forum Statistics

• Total Topics
632591
• Total Posts
3007250

×

Important Information

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!