473,386 Members | 1,832 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,386 software developers and data experts.

why doesnt user control support transparent ?

Tom
why doesn't user control support transparent ?
even after you programmatically make it transparent the controls that you
add on it still doesn't transparency where they normally would in a winform
why is that ?

Tom
Jul 21 '05 #1
6 3580
Tom,

I believe it has something to do with win32 itself, and not .NET in
particular. While it's not the best answer, MS's overall response to this
will be to use Avalon, which will correctly support control transparency.

Otherwise, you would have to keep track of all the windows below yours,
and paint it manually.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tom" <to********@optushome.com.au> wrote in message
news:41***********************@news.optusnet.com.a u...
why doesn't user control support transparent ?
even after you programmatically make it transparent the controls that you
add on it still doesn't transparency where they normally would in a
winform
why is that ?

Tom

Jul 21 '05 #2
Tom,

Try this

Me.SetStyle(ControlStyles.SupportsTransparentBackC olor, True)
Me.BackColor = Color.Transparant

I hope this helps

Cor

"Tom" <to********@optushome.com.au>
why doesn't user control support transparent ?
even after you programmatically make it transparent the controls that you
add on it still doesn't transparency where they normally would in a winform why is that ?

Tom

Jul 21 '05 #3
I answered it from the general group. It is VB style, so "me" has to be
"this" for C# and it has to be closed with ; watch also the cases I did not
real check for that.

Me.SetStyle(ControlStyles.SupportsTransparentBackC olor, True)
Me.BackColor = Color.Transparant

I hope this helps

Cor

"Tom" <to********@optushome.com.au>
why doesn't user control support transparent ?
even after you programmatically make it transparent the controls that you add on it still doesn't transparency where they normally would in a

winform
why is that ?

Tom


Jul 21 '05 #4
Tom
I have no problem with the usercontrol being transparent.. but it seens for
EVERY control I add to the usercontrol I need to write a separate inherited
control to make it transparent and its a headache for me.

Thanks anyway
Tom
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:es**************@TK2MSFTNGP10.phx.gbl...
Tom,

Try this

Me.SetStyle(ControlStyles.SupportsTransparentBackC olor, True)
Me.BackColor = Color.Transparant

I hope this helps

Cor

"Tom" <to********@optushome.com.au>
why doesn't user control support transparent ?
even after you programmatically make it transparent the controls that you add on it still doesn't transparency where they normally would in a

winform
why is that ?

Tom


Jul 21 '05 #5


Hi tom the method you suggest does not make a windows form control for C#
transparent. Although transparent is initially accepted the program crashes
after a few seconds. The code for C# is also different from this even
including "this" and";"

AR
Jul 21 '05 #6
You can utilize this code to make an user control transparent:

In the user control's Load event:

SetStyle(ControlStyles.SupportsTransparentBackColo r, True)
Me.BackColor = Color.FromArgb(0, 0, 0, 0)

I actually just found the above code on a web page couple hours ago (sorry,
I don't have the link handy). It seems to work fine in VS 2003, but in my
case, the background is just a colored panel. I have also seen messages
that indicates that there is a bug in the Whidbey release that causes the
underlying display to not display properly.

Richard Rosenheim

"ARtone" <AR****@discussions.microsoft.com> wrote in message
news:AA**********************************@microsof t.com...


Hi tom the method you suggest does not make a windows form control for C#
transparent. Although transparent is initially accepted the program crashes after a few seconds. The code for C# is also different from this even
including "this" and";"

AR

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape...
7
by: Chuck | last post by:
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...
4
by: Tom | last post by:
why doesn't user control support transparent ? even after you programmatically make it transparent the controls that you add on it still doesn't transparency where they normally would in a winform...
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 ...
2
by: M West | last post by:
hello, currently trying to write a custom control that will display an image in true transparent form, e.g. can actually see the background images placed behind the control rather than the...
1
by: FredC | last post by:
I'm using VS 2003, C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a...
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...
12
by: effendi | last post by:
I wrote the following function and tested it in MSIE, Firefox and Mac Safari, Works in all but the Safari. What can I do to rectify this? function processBackground(){ for (n=1;n<11;n++) { ...
0
by: MasterOfTheDark | last post by:
This one's a hairy one to explain. What I've got is a class called "VistaGroupBox" that I put some nice-looking Vista-style gradients in the background and made to look like the ribbon categories...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.