473,782 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3437
* "Rob Richardson" <no*******@n2ne t.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2613
by: Jay | last post by:
Hi everybody! Please help me with this problem. I try to write code for server side data validation. Initially, I have a html file called "form.html" which just contains all the necessary fields for user to submit their contact info (name, phone, email, address.....etc...). All user's input will be sent to "processForm.php" using POST. In processForm.php, I want to be able to re-display the form in "form.html" with valid user's input and...
0
1263
by: B-Dog | last post by:
I'm using this class here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/printwinforms.asp to build a tabular print report and it works fine but when I try and add a rectangle to the page they brush stroke is huge, about .5 inch wide? The document is setup in inches but I don't know why these are showing up like this, nevers seen this happen. Here is the code I'm using below but there must be something...
1
6103
by: tejesht | last post by:
Hello everybody, I want to notify the user about a particular area on a image by drawing a rectangle around that area. Can any one suggest me for the same. Please specify the code too. Thanks in Advance Tejesht
1
3779
by: Jeff Waskiewicz | last post by:
Hello All, I'm trying to solve a nagging problem. The goal is to draw a rectangle over the top of all the other controls on a form. Specifically, over a ChartFX control. The user would draw the rectangle using the right mouse button to represent the area of the chart they want to zoom on. I haev been able to draw the rectangle on a blank form but I cannot get it to draw on top of other controls. I have pasted in the code i am using ....
0
1297
by: Adam Clauss | last post by:
I have a ListView in which I am attempting to get it to not draw the 'dotted' rectangle around items which are selected. All other drawing should be normal. I am using the listbox in SmallIcon mode (has an icon + label). I've tried setting various properties, even overriding my own ListView class, but I cannot seem to find the right combination. Any thoughts? -- Adam Clauss
10
5469
by: kimiraikkonen | last post by:
Hi, If previous post was missing, here's the complete one: I'm trying to draw a rectange on a picturebox image using mouse move event but the problem is that the rectangle selection / drawing cannot be done from starting from bottom-right to up-left. The only selection i'm allowed to do is starting from top-left towards bottom-right orientation. The code is:
0
2352
by: Red Head | last post by:
Hello I've written some code to draw a rectangle on a picture box when the user moves the mouse. (the previous rectangle is cleared) This works fine but the very first rectangle is not removed from the screen. here is my code private Rectangle r = new Rectangle(new Point(0,0), new Size(0,0));
0
992
by: joshguru | last post by:
i have a button in my form in vb.net.i have to click the button and i have to draw a rectangle by mouse....ie using button click event i have to draw as my desired size....
1
5135
by: kummu4help | last post by:
hi, i want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the following code. in the following code i am using SelectionArea class which extends a canvas on which i am performing drawing operation. i am using image variable in this class for double buffering to reduce flickering and to save the applet's previous...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5509
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.