My goal is to draw a Group Box that is not rectangular but instead has the corners cut away. I do not mean just clipping the corners, but rather have a continuous closed path where the corners are "indented." I want this to match the colors/style of the current theme.

I noticed on Windows XP that the Group Box has 1-pixel gray lines, but on Windows 7 there is a 3D effect created by having a gray line next to a white line (the white line on the interior except on the bottom where it's below the gray line).

You can get the color of the text label of a Group Box using something like this:

COLORREF cref;
GetThemeColor(hTheme, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);

So, I'm trying to figure out how to get the color(s) and/or properties of the lines used in a Group Box, then (I hope to) be able to draw the lines I want matching the Group Box style by separately drawing each piece of the shape I want. I'm not sure what properties are used to describe the lines or if functions line DrawRect will draw the 3D effect with a suitable Pen. Is there a way to set a Pen to draw these 3D effects (2-shade parallel lines)?

Thanks.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top