Selection rectangle drawing over eveything in its container

  • Thread starter Philippe Meunier
  • Start date
P

Philippe Meunier

Hi,

I would like to know How I could draw a Dashed rectangle over everything in
a container. I will use this to draw a selection rectangle (like in VB.NET
Form Designer UI). And even it draws in invert colors I think, but this is
not necessary for now.

Can I do this with a usercontrol ? Because I know that transparency is a
little tricky in VB.NET, for usercontrols.
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

As far as I remember the Graphics class can be created for a control.
Therefore, you should capture the mouse, create the Graphics instance, react
to mouse events and re-draw the selection rectangle accordingly, and then
release the mouse and dispose the Graphics.

Just a suggestion though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top