Re: Draw over controls
- From: Pavel Minaev <int19h@xxxxxxxxx>
- Date: Mon, 4 Aug 2008 09:07:36 -0700 (PDT)
On Aug 4, 6:54 pm, Brandon Arnold <reason...@xxxxxxxxx> wrote:
I have a panel that contains a label and a picturebox. When clicked, I
want to draw a rectangle over everything. I can draw the rect and set
the color, no big deal. The problem is because I have to pass the rect
of the panel, it draws on that, and under the other controls. How can
I force it to draw OVER everything else? Ideally this would also be
trackable since the whole thing(panel and children) will be dragable.
You shouldn't really draw outside Paint events, because other controls
can decide to redraw at arbitrary moment of time, and will erase your
changes. Instead, just create an empty Panel of the desired color, and
place it where you want your rectangle to be displayed. If you want
some fancy filling on the panel (gradient, etc), then, instead of
changing its BackColor, handle its Paint event and paint whatever you
want in it.
.
- Follow-Ups:
- Re: Draw over controls
- From: Brandon Arnold
- Re: Draw over controls
- References:
- Draw over controls
- From: Brandon Arnold
- Draw over controls
- Prev by Date: Re: xml and character codes such as É
- Next by Date: Re: DataTable to DataTable
- Previous by thread: Draw over controls
- Next by thread: Re: Draw over controls
- Index(es):
Relevant Pages
|