tags:

views:

451

answers:

3

I'm trying to create an edit control with the regular 3D border around it (in the classic windows style, anyway), but it just has a 1px black border around it. Here is my CreateWindowEx call:

return CreateWindowEx(0, "EDIT", "E:\\bk",
                      WS_VISIBLE | WS_CHILD | WS_BORDER | ES_LEFT,
                      87, 81, 150, 17,
                      main_window.hwnd,
                      (HMENU)5, hInstance, NULL);

If I exclude WS_BORDER then it's just a white box. Any ideas on what's wrong here?

Update

WS_EX_CLIENTEDGE did the trick. I don't know anything about manifest files, or how to make the window use the more modern windows themes (XP, for example), instead of the chunky 3D borders. But, when I do learn all that, will WS_EX_CLIENTEDGE make them use those themes instead, or will it enforce the 3D look?

A: 

I think you mean the 'WS_EX_DLGMODALFRAME' style. It makes it look like the old-style 3d raised type look. Combined with 'WS_BORDER' to make it look a like a 3d border around the control.

Shane Powell
+2  A: 

Try using WS_EX_CLIENTEDGE. That will create an inset 3-D window border under typical situations.

return CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "E:\\bk",
                      WS_VISIBLE | WS_CHILD | WS_BORDER | ES_LEFT,
                      87, 81, 150, 17,
                      main_window.hwnd,
                      (HMENU)5, hInstance, NULL);

Also see the following link for the rest of the available flags for CreateWindowEx.

CreateWindowEx at MSDN

meklarian
+1  A: 

He is right WS_EX_CLIENTEDGE will do the 3D border.

Kornalius