user4344762
user4344762

Reputation:

How to create a vertical line?

I want to place a vertical line on my Window like the following:

enter image description here

I have tried to create a "STATIC" control with the SS_SUNKEN style and with a width of 2:

CreateWindowEx(NULL, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_SUNKEN, 10, 10, 2, 200, hParentWindow, NULL, GetModuleHandle(NULL), NULL);

It had worked, but I am wondering if this is the correct way of doing it?

Upvotes: 0

Views: 425

Answers (2)

IInspectable
IInspectable

Reputation: 51463

An alternative to using a Static control is to render the sunken border yourself.

If no theme is applied, use DrawEdge.

If a theme is applied to the window, call DrawThemeBackground passing GP_LINEVERT for iPartId. See Parts and States for additional information on theme rendering.

Upvotes: 1

Don Reba
Don Reba

Reputation: 14051

You could also use the DrawEdge function if you wanted to do the drawing yourself.

Upvotes: 1

Related Questions