What control is this?

  • Thread starter Thread starter Max
  • Start date Start date
M

Max

Take a look at this screenshot that I've made:
http://www.subdir.net/myFiles/line_ss.jpg

I've circled the two lines that separate different sections of the form.
Does anybody know how to make those same lines in VB .NET? Look all over
but can't find anything that looks like it, the only thing that comes
close is a group box that only has a width but no height, but that
doesn't look too good around the edges. Please let me know if you have
an idea on how to make this.
 
Take a look at this screenshot that I've made:
http://www.subdir.net/myFiles/line_ss.jpg

I've circled the two lines that separate different sections of the form.
Does anybody know how to make those same lines in VB .NET? Look all over
but can't find anything that looks like it, the only thing that comes
close is a group box that only has a width but no height, but that
doesn't look too good around the edges. Please let me know if you have
an idea on how to make this.

It is a GroupBox. The "Size" property contains both Width and Height.
Setting the Height to 4 gives the appearance your showed in your image.
 
I've done the groupbox thing before too and didn't like the results. I've
toyed before with drawing it myself with GDI (seemed like overkill). I
awaiting to here what others would do.

Greg
 
Patrick said:
It is a GroupBox. The "Size" property contains both Width and Height.
Setting the Height to 4 gives the appearance your showed in your image.

Doesn't seem to work for me, here's what I get:
http://www.subdir.net/myFiles/line_ss2.jpg

You see a little piece on the right that starts going down. That side
always looks like that no matter what height I set (4,3,2, etc...).
 
I just tried with height 4 and it has just the hint of a vertical line still
on the far right. :(
 
* Max said:
Take a look at this screenshot that I've made:
http://www.subdir.net/myFiles/line_ss.jpg

I've circled the two lines that separate different sections of the
form. Does anybody know how to make those same lines in VB .NET? Look
all over but can't find anything that looks like it, the only thing
that comes close is a group box that only has a width but no height,
but that doesn't look too good around the edges. Please let me know if
you have an idea on how to make this.

Have a look at this discussion (complete thread):

<URL:http://www.google.de/[email protected]>
 
* "Greg Burns said:
I've done the groupbox thing before too and didn't like the results. I've
toyed before with drawing it myself with GDI (seemed like overkill). I
awaiting to here what others would do.

I posted a link to a discussion containing some suggestions as a reply
to the OP.
 
Hi Greg,

If you look at the properties dialog box for a file in a program such as
explorer there is a vertical line on the far right on these also. If this
really annoys you, then you could draw the lines in the Paint event. The
colors for the two lines, I believe are
System.Drawing.SystemColors.ControlLightLight and
System.Drawing.SystemColors.ControlDarkDark (I might be wrong on that, but
play around a little and you'll get it).

Usually when I want to draw a dip, I do just this, draw two lines in the
Paint event. You can use the Frame/Group control as others have suggested
though. It's up to you.

Thanks,

Andrew

Greg Burns said:
I just tried with height 4 and it has just the hint of a vertical line still
on the far right. :(
 
If you look at the properties dialog box for a file in a program such as
explorer there is a vertical line on the far right on these also.

Curious. What OS are you seeing that with? My XP Pro doesn't have it.

Greg
 
Hi Greg,

I too have XP Pro and rest assured it is there. It is also there in other
OS's such as Win 98. I've been using such lines in my programming for years.
You can use the Magnifier under Accessories to inspect it.

There is *NO* control in VB6 or VB .NET that can mimic this except the
GroupBox/Frame control. I tried one right now, just to ensure my sanity, and
it works.

Like I said, your other alternative is the Paint event (which would most
like use less resources). Of course, you could make your own control if this
really bothering you.

If you do use a GroupBox control, ensure that you clear the Text property
and set the height to 2 pixels.

Andrew
 
Herfried said:
Have a look at this discussion (complete thread):

<URL:http://www.google.de/[email protected]>

Big thanks for that. For everyone else trying to make this work, take a
look here: http://www.codeproject.com/cs/miscctrl/hvrules1.asp

Download the .dll file from there, add it to your resources, and then
you use Covidimus.Forms.HorizRule to add a line like that. Since it
doesn't show up on the actual controls you'll have to add it manually to
the form in the Windows Form Designer generated code region, but after
it shows up for the first time you can just copy and paste it for more
instances.

A bit more work then I would like, but hey, it works:
http://www.subdir.net/myFiles/line_ss3.jpg
 
Andrew said:
Hi Greg,

I too have XP Pro and rest assured it is there. It is also there in other
OS's such as Win 98. I've been using such lines in my programming for years.
You can use the Magnifier under Accessories to inspect it.

There is *NO* control in VB6 or VB .NET that can mimic this except the
GroupBox/Frame control. I tried one right now, just to ensure my sanity, and
it works.

Like I said, your other alternative is the Paint event (which would most
like use less resources). Of course, you could make your own control if this
really bothering you.

If you do use a GroupBox control, ensure that you clear the Text property
and set the height to 2 pixels.

Andrew

Don't have the line on mine either, I don't have the Magnifier
installed, but even if I take a screenshot and zoom in on that there is
nothing there, just a straight line.

Now as for actually making this work, see my reply to Herfried K.
Wagner. The article here:
http://www.codeproject.com/cs/miscctrl/hvrules1.asp makes this all
happen very nicely.
 
Did you try the label set to Fixed 3d Width, no text, and height 3px? Taste
great, less filling.
 
Hi Greg,

It's hardly an artifact of compression... Microsoft actually meant it to
look like this.

The dip (as it's called) is formed by two horizontal lines on top of each
other with a vertical line appearing on the right. The upper line is a
darker color and the lower line and vertical is a lighter color. Usually
dark gray and white if you're using the Standard Windows color
configuration.

If you found a solution that works for you, good. Nuff said about a line.

Andrew
 
Take a look at this screenshot that I've made:
http://www.subdir.net/myFiles/line_ss.jpg

I've circled the two lines that separate different sections of the form.
Does anybody know how to make those same lines in VB .NET? Look all over
but can't find anything that looks like it, the only thing that comes
close is a group box that only has a width but no height, but that
doesn't look too good around the edges. Please let me know if you have
an idea on how to make this.

For reference, I use a 2-pixel-high Label with border set to 3D. I've only
looked at it under the XP Windows Classic theme (no Fisher-Price buttons for
me!) so I can't say if it works with the standard theme.
 
Jeff,

* "Jeff Johnson said:
For reference, I use a 2-pixel-high Label with border set to 3D. I've only
looked at it under the XP Windows Classic theme (no Fisher-Price buttons for
me!) so I can't say if it works with the standard theme.

It looks the same even with Windows XP Visual Styles turned on.
 
Back
Top