469,602 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Can I draw a rectangle on a form?

Greetings!

I am creating a form that will contain information that will eventually be
on a label. The label has a 2-column table with lines separating the cells.
I want my form to resemble the label, so I want to draw a rectangle and
lines on my form. I don't want them to have any user interaction whatever.
They would be there just to look pretty.

There's plenty of support for drawing rectangles from code. There seems to
be support for drawing rectangles from within a resource. But I don't see a
way just to draw a plain ordinary rectangle on a form at design time! We
could do it in VB6, if I remember correctly. Can't we do it in VB.Net?

Rob, who had hopes that our friends in Redmond finally figured out how to
give VB programmers something they could work with intelligently, but is
learning that the product isn't quite there yet.
Nov 20 '05 #1
1 3102
* "Rob Richardson" <no*******@n2net.net> scripsit:
I am creating a form that will contain information that will eventually be
on a label. The label has a 2-column table with lines separating the cells.
I want my form to resemble the label, so I want to draw a rectangle and
lines on my form. I don't want them to have any user interaction whatever.
They would be there just to look pretty.

There's plenty of support for drawing rectangles from code. There seems to
be support for drawing rectangles from within a resource. But I don't see a
way just to draw a plain ordinary rectangle on a form at design time! We
could do it in VB6, if I remember correctly. Can't we do it in VB.Net?


There are no Shape controls available in Windows Forms any more. You
will have to draw the rectangle at runtime, for example in the form's
overridden 'OnPaint' method.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Jay | last post: by
reply views Thread by B-Dog | last post: by
10 posts views Thread by kimiraikkonen | last post: by
reply views Thread by joshguru | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.