From: Stanza on
I would like to include a "separator" in my dialog boxes, which is a single
line with text on its left hand side. I don't think there is an actual
separator control available so you have to draw one yourself by writing the
text and drawing the line.

How can I draw the line so that it has the same appearance as the square
which is drawn around a group box? The line drawing style of group boxes
seems to vary in different versions of Windows, and I'd like my separator's
line to match the appearance of a group box.

From: Christian ASTOR on
On 30 oct, 19:25, "Stanza" <sta...(a)devnull.com> wrote:
> I would like to include a "separator" in my dialog boxes, which is a single
> line with text on its left hand side. I don't think there is an actual
> separator control available so you have to draw one yourself by writing the
> text and drawing the line.
>
> How can I draw the line so that it has the same appearance as the square
> which is drawn around a group box? The line drawing style of group boxes
> seems to vary in different versions of Windows, and I'd like my separator's
> line to match the appearance of a group box.

A Group box is drawn with DrawEdge()
(or DrawThemeBackground() if themed)
From: Bob Masta on
On Fri, 30 Oct 2009 18:25:12 -0000, "Stanza"
<stanza(a)devnull.com> wrote:

>I would like to include a "separator" in my dialog boxes, which is a single
>line with text on its left hand side. I don't think there is an actual
>separator control available so you have to draw one yourself by writing the
>text and drawing the line.
>
>How can I draw the line so that it has the same appearance as the square
>which is drawn around a group box? The line drawing style of group boxes
>seems to vary in different versions of Windows, and I'd like my separator's
>line to match the appearance of a group box.
>

I haven't tried this myself, but I wonder if you
could just use a Groupbox with width and length
set to fall on the dialog borders, hopefully
making the sides and bottom unseen.

Just a thought...


Bob Masta

DAQARTA v4.51
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, Sound Level Meter
FREE Signal Generator
Science with your sound card!
From: Dee Earley on
On 31/10/2009 14:02, Bob Masta wrote:
> On Fri, 30 Oct 2009 18:25:12 -0000, "Stanza"
> <stanza(a)devnull.com> wrote:
>
>> I would like to include a "separator" in my dialog boxes, which is a single
>> line with text on its left hand side. I don't think there is an actual
>> separator control available so you have to draw one yourself by writing the
>> text and drawing the line.
>>
>> How can I draw the line so that it has the same appearance as the square
>> which is drawn around a group box? The line drawing style of group boxes
>> seems to vary in different versions of Windows, and I'd like my separator's
>> line to match the appearance of a group box.
>>
>
> I haven't tried this myself, but I wonder if you
> could just use a Groupbox with width and length
> set to fall on the dialog borders, hopefully
> making the sides and bottom unseen.
>
> Just a thought...

I use DrawEdge. Admittedly, it won't use any Windows Theme settings, but
you can use the Theme API directly for that.

SetRect r, 0, 0, ScaleWidth, ScaleHeight
DrawEdge hDC, r, BDR_SUNKENOUTER, BF_RECT

This rect is limited to 2 pixels high.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems