471,350 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Creating a truly transparent control

Hi,
I found this online:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
so I created a new class (called TransparentControl), put the above in it,
then on my normal form I made the label private TransparentControl label7;
and changed the appropriate line in InitializeComponent() this.label7 = new
HCAUT.TransparentControl();. I also made the backcolor of the label
Transparent. But when I run everything, the label's backcolor still isn't
transparent. Does anyone know what I'm doing wrong?
Thanks so much!
Mel
Feb 2 '06 #1
2 7348
Try the method outlined at the link below.

--
Tim Wilson
..NET Compact Framework MVP
"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Hi,
I found this online:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
so I created a new class (called TransparentControl), put the above in it,
then on my normal form I made the label private TransparentControl label7;
and changed the appropriate line in InitializeComponent() this.label7 = new HCAUT.TransparentControl();. I also made the backcolor of the label
Transparent. But when I run everything, the label's backcolor still isn't
transparent. Does anyone know what I'm doing wrong?
Thanks so much!
Mel

Feb 2 '06 #2
Posted too soon. Here's the link.
http://www.c-sharpcorner.com/Code/20...ntControls.asp

--
Tim Wilson
..NET Compact Framework MVP

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Try the method outlined at the link below.

--
Tim Wilson
.NET Compact Framework MVP
"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
Hi,
I found this online:
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
so I created a new class (called TransparentControl), put the above in it, then on my normal form I made the label private TransparentControl label7; and changed the appropriate line in InitializeComponent() this.label7 =

new
HCAUT.TransparentControl();. I also made the backcolor of the label
Transparent. But when I run everything, the label's backcolor still isn't transparent. Does anyone know what I'm doing wrong?
Thanks so much!
Mel


Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Efkas | last post: by
3 posts views Thread by Steve Koon | last post: by
4 posts views Thread by jcrouse | last post: by
2 posts views Thread by Martin | last post: by
3 posts views Thread by T Clancey | last post: by
8 posts views Thread by Brian Ward | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.