Skip to main content
GameDev.net gamedev.net
🔒 Locked

Win32 Edit Control

Started by j0mich01 Sep 30, 2008 at 9:42 AM 1 replies 1.4k views
Original Post
j0mich01
j0mich01
Whenever I create a EDIT control with the following code it looks very flat and unappealing without any type of border. I'm trying to get it to look like the basic dialog edit box with sunken edges, but I can't seem to find the right combonation of styles. HWND WidthEdit = CreateWindow(L"Edit",NULL,WS_CHILD|WS_VISIBLE|ES_NUMBER, 50,30,100,30,m_window,(HMENU)EDIT_WIDTH,GetModuleHandle(NULL),NULL); I'm also curious as to whether or not it is preferred to create forms at runtime like this, or just package them into a resource file and load it as a Dialog Box. Thanks in advance.
Erik Rufelt
Erik Rufelt
Use CreateWindowEx and set the ex-style to WS_EX_CLIENTEDGE.
CreateWindowEx(WS_EX_CLIENTEDGE, ....);
The parameters are the same as for CreateWindow you have now, only you can add an ex-style as a first argument.
j0mich01
j0mich01
Thanks alot, it worked, I though I had tried that but I guess not. Thanks again

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.