Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bring drawn rectangle to front

Status
Not open for further replies.

TweeZz

Programmer
Feb 19, 2004
1
CZ
Hello all...

I have a problem (of course) and I can't seem to find a solution (of course).
Let me describe the problem. I have a GroupBox (VisualShed) which can contain a few PictureBoxes (Carpets). If there are no Carpet's in the VisualShed and I draw a rectangle, the rectangle is visible. So far so good...
But when the VisualShed contains some Carpets and I draw the rectangle again, I only can see the rectangle in the VisualShed on the places where there is no carpet.
Is there a way to bring the drawn rectangle in front of the Carpets?
To make it more clear I have made a screenshot which you can find here:

The problem (I think) is that I have to use the Graphics object of the GroupBox, because that is where I have to draw the rectangle. I have to be able to draw the rectangle over more than 1 Carpet.
I also tried to draw a rectangle on a Carpet itself (so with the graphics object of a carpet) and even that wouldn't work?

I have tried different things:
SetStyle(opaque, true);
BringToFront();

I hope someone can help me out here because the problem is driving me :sigh:
I don't have much experience in C# but I'm learning... I realy want to get this program solved!

Thanks in advance!

GreetZz,
TweeZz.

ps: If the problem doesnt seem clear... You can always ask me for the sourcecode!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top