To make your user control transparent, Add code describled in three steps
Step 1 -
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020;
return cp;
}
}
Step 2:
protected override void OnPaintBackground(PaintEventArgs e)
{
// dont code anything here. Leave blank
}
Step 3
protected void InvalidateEx()
{
if(Parent==null)
return;
Rectangle rc=new Rectangle(this.Location,this.Size);
Parent.Invalidate(rc,true);
}
After doing 3 steps, place your user control in the form. Its going to be
transparents. The controls placed on usercontrol will be visible.
--
Shak
(Houston)
"Chuck" <ce*****@austin.rr.com> wrote in message
news:hF*****************@fe1.texas.rr.com...
I am working in C# 2003.
Can anyone tell me how to make a user control transparent. VS help
doesn't help.
What I want to do is draw on a user control during design time and then
place the control on another form. All I want to see is the drawing and I
want anything behind the drawing to show through.
TransparencyKey and Opacity don't compile.
Chuck