drawing a rectangle on top of other items

vinnie881

Well-known member
Joined
Sep 3, 2006
Messages
152
Programming Experience
3-5
I am trying to figure out how to draw a rectangle (Or any graphic for that matter) that can show ontop of all controls in a form

If I have a control with a listbox in the middle of the form, I can draw the graphic by using the creatgraphics for either on the list box, or the form, but either way it does not show accross the whole form.

If I do iton the list box it only shows on the listbox, if I do it on the form, the listbox will cover it.


Does anyone know if this is possible to do w/o puttin a panel, or something over the items.

Another question along the same lines, is there anyway to draw a image/rectangle that appears on top of all applications?

Thanks!
 
Here is how I did it. I used a form with the invisible color set to the background color. Attached is a short program.
Hope this helps.
 

Attachments

  • WindowsApplication2.zip
    10.4 KB · Views: 27
This works well, Just curious though I am using vs 2003, What do the using key words do in 05? Do they just dispose the object when the End Using is called?
 
Yes. You don't have to worry about disposing of the object. However, you can only use it explicitly with one object. In other words:
VB.NET:
	Using bmp As New Bitmap("c:\tom.bmp")

	End Using
Works
and
VB.NET:
	Using bmp As Bitmap

	End Using
Does not work.
 
Back
Top