Re: Transparent Panel
- From: Fabien <fab_00_2002@xxxxxxx>
- Date: Thu, 6 Dec 2007 05:18:00 -0800 (PST)
Yes ok sorry I didn't understand what you needed. I think you can't
with a panel but you can create a Form and override the OnPaint method
of your Form and draw and fill the form you want. You will obtain 2
Forms but the second one will have transparent background.
Hope this help you
BR
Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant
ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/ | http://fabdecret.blogspot.com/
On 4 déc, 19:17, Simon <Si...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I can't read that post however it looks like its just doing transparent
bitmaps?
I am wanting a Panel to be transparent. So if a panel is ontop of a
PictureBox any controls in the Panel won't render a big white rectangle on
the Panel.
Thanks and take care.
"Fabien" wrote:
Hi,
Check out this:
http://fabdecret.blogspot.com/2007/11/transparent-background.html
But, it is only available for one transparency colour !
BR
Fabien Decret (Device Application Development MVP)
Windows Embedded Consultant
ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/
On Dec 4, 6:12 pm, Simon <Si...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hey gang.
I am working on making a transparent panel control. How this control works
is making itself invisible then invalidating its parent.
This works great until you get panels in panels & using auto scroll on the
Panel because the flickering that occurs when scrolling.
I am thinking this is because its invalidating a parent which invalidates
its parent etc and I believe its probably getting up to invalidating the form
level.
I am trying to achieve Panels that are transparent so if there is a
PictureBox behind them, it will show through.
As follows:
protected override void OnPaintBackground(PaintEventArgs e)
{
if (this.BackColor == Color.Transparent)
return;
base.OnPaintBackground(e);
}
protected override void OnPaint(PaintEventArgs e)
{
if (this.BackColor == Color.Transparent)
{
if (!isPaintBackgroundComplete)
{
this.Visible = false;
this.Parent.Invalidate(Bounds);
this.Parent.Update();
this.Visible = true;
isPaintBackgroundComplete = true;
return;
}
isPaintBackgroundComplete = false;
}
}
Is there a better way to achieve this? As mentioned this mostly flickers
when scrolling because I think its invalidating 2-3-4 parents up to the form
level.
Is there any PInvoke support that could help out here? I could not find
anything on google. Everything I saw was for the full framework.
I would appreciate any help.
Thanks and take care.- Masquer le texte des messages précédents -
- Afficher le texte des messages précédents -
.
- Follow-Ups:
- Re: Transparent Panel
- From: Simon
- Re: Transparent Panel
- References:
- Transparent Panel
- From: Simon
- Re: Transparent Panel
- From: Fabien
- Re: Transparent Panel
- From: Simon
- Transparent Panel
- Prev by Date: Re: ObjectDisposedException
- Next by Date: Re: Microsoft.WindowsMobile.Telephony
- Previous by thread: Re: Transparent Panel
- Next by thread: Re: Transparent Panel
- Index(es):
Relevant Pages
|
Loading