473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 7439
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: °Ë´óɽÈË | last post by:
HI, I create a custom transparent control, set the style is ControlStyles.DoubleBuffer, It display black background. How to create a double buffer transparent control?
1
by: Efkas | last post by:
My application have some level : 1. MyButton class with Label inheritance 2. MyComponent as User Control loading and positionning some of MyButtons 3. MyApp loading and positionning MyComponent ...
0
by: felix | last post by:
Hi, I'm trying to subclass System.Windows.Forms.Control to create a Control that is fully transparent. I'd like to place this control over other Controls in order to display additional...
3
by: Steve Koon | last post by:
Any thoughts on getting this project to work or suggesting another method would be appreciated. Steve ========================================== Project: A Windows Form which acts as a...
4
by: jcrouse | last post by:
I am using the following code to move a label on a form at runtime: If myMousedown = lblP1JoyRight.Name Then If lblP1JoyRight.BackColor.Equals(Color.Transparent) Then bTransCk = True ...
2
by: Martin | last post by:
I've been complaing about the VB2005 Help-Information (or rather the lack of it) before, but when I was looking how to set the backstyle of a label control to "Transparent" I found that the VB2005...
4
by: ray well | last post by:
in my app i need to make a RichTextbox control transparent. i need it to be a like a pane of glass lying on a sheet of paper, where u can see everything on the sheet of paper not covered by text...
3
by: T Clancey | last post by:
Hi all. I've been working on a small and very simple label design app for a few days now, I've got most of my problems solved, although I'm sure there are some more just around the corner! ...
8
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.