Alex
Alex

Reputation: 2111

VB.Net / Winform - draw a line?

I'm using visual studio 2010 and vb.net. On my form I have an Group Box that I use to visually segment various controls on the form. My question is how can I add a horizontal line that looks the same as the border lines of the Group Box?

Upvotes: 1

Views: 4331

Answers (3)

Hans Passant
Hans Passant

Reputation: 941218

Jonathan is a heckofalot closer then he might have thought. Add a GroupBox, set the Text property to an empty string, change the Size property to make the Height equal to 2. Presto, horizontal carved battle-ship gray line like seen on many dialogs.

Upvotes: 1

Jeff Roe
Jeff Roe

Reputation: 3206

I'm not sure how an option box would visually segment controls, but have a look at the LineShape control in the Visual Basic PowerPacks (from Microsoft).

(Google "Visual Basic PowerPacks", download it from MS, then install it.)

Upvotes: 0

Jonathan Wood
Jonathan Wood

Reputation: 67175

My preference would be to use a group box, as this is more standard.

If you need something custom, use write your own Paint handler to paint whatever you need.

Upvotes: 0

Related Questions