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

Transparency


Hi!

I need to create a user control with transparent background. Picturebox
for example doesn't show any other control under it even if it has the
background color set to transparent.

Which control should I use?

Thanks
Marco / iw2nzm

Jun 14 '07 #1
5 2061
You can set the SupportsTransparentBackgroundColor bit in the constructor of
your user control using MyBase.SetStyle. This will allow you to set the
control's BackColor property to a color with an alpha value other than 255.

- Andrew

"Marco Trapanese" <ma******************@libero.itwrote in message
news:O0********************@twister1.libero.it...
>
Hi!

I need to create a user control with transparent background. Picturebox
for example doesn't show any other control under it even if it has the
background color set to transparent.

Which control should I use?

Thanks
Marco / iw2nzm
Jun 14 '07 #2
Andrew Christiansen wrote:
You can set the SupportsTransparentBackgroundColor bit in the
constructor of your user control using MyBase.SetStyle. This will allow
you to set the control's BackColor property to a color with an alpha
value other than 255.

Thanks for your answer. I already did it. But it doesn't works.
The background will be transparent to the form but not to other controls
behind it.

Example:

Place a button in the middle of the form. Place a picture box over it
and set the background color of the picture box as transparent. It
doesn't show the button.

This is what I want! :)

Bye
Marco / iw2nzm
Jun 15 '07 #3
On Jun 15, 2:19 am, Marco Trapanese <marcotrapaneseNOS...@libero.it>
wrote:
Andrew Christiansen wrote:
You can set the SupportsTransparentBackgroundColor bit in the
constructor of your user control using MyBase.SetStyle. This will allow
you to set the control's BackColor property to a color with an alpha
value other than 255.

Thanks for your answer. I already did it. But it doesn't works.
The background will be transparent to the form but not to other controls
behind it.

Example:

Place a button in the middle of the form. Place a picture box over it
and set the background color of the picture box as transparent. It
doesn't show the button.

This is what I want! :)

Bye
Marco / iw2nzm
AFAIK, there is not a way to do this with a control. What exact are
you trying to accomplish - perhaps we know of a better way? Also, GDI+
supports alpha drawing, so you might look into using it to drawing
directly onto the form instead of just placing a control.

Thanks,

Seth Rowe

Jun 15 '07 #4
rowe_newsgroups wrote:
AFAIK, there is not a way to do this with a control.
urgh :(
What exact are
you trying to accomplish - perhaps we know of a better way? Also, GDI+
supports alpha drawing, so you might look into using it to drawing
directly onto the form instead of just placing a control.
Ok! I use GDI+ but I'd like to do something like this (I hope I can
explain it with my poor English!)

I created a progress bar with an 'angle' property which draws the bar in
any direction. However, the container of the control is a box. I need to
put several progress bars over each other. I might draw each bar
directly on the form but it would be nice if I can use them separately
as user control.

The transparency is required because the unused space around the bar
must shows other controls behind it.
Jun 15 '07 #5
On Jun 15, 5:59 am, Marco Trapanese <marcotrapaneseNOS...@libero.it>
wrote:
rowe_newsgroups wrote:
AFAIK, there is not a way to do this with a control.

urgh :(
What exact are
you trying to accomplish - perhaps we know of a better way? Also, GDI+
supports alpha drawing, so you might look into using it to drawing
directly onto the form instead of just placing a control.

Ok! I use GDI+ but I'd like to do something like this (I hope I can
explain it with my poor English!)

I created a progress bar with an 'angle' property which draws the bar in
any direction. However, the container of the control is a box. I need to
put several progress bars over each other. I might draw each bar
directly on the form but it would be nice if I can use them separately
as user control.

The transparency is required because the unused space around the bar
must shows other controls behind it.
Instead of using a box as the container of your control, set the
controls Region property to the exact shape that you need.

Have you considered using WPF? With WPF its almost trivial to display
any control at an angle.

Chris

Jun 15 '07 #6

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

Similar topics

2
by: Cecile Muller | last post by:
I've been trying to just open a png and display it, that way: <? header ("Content-type: image/png"); $im = imagecreatefrompng('empty.png'); imagepng($im); ?> But the transparency is not...
57
by: Piotr Wolski | last post by:
how to make my page that it was correct with every browser standard? for example when i change HTML's table size it has no effect when i see it under mozilla and has effect under Internet...
4
by: Matthias Czapla | last post by:
Hi! I want to resize uploaded GIF images. Currently I do it like this: <?php // ... $img = imagecreatefromgif($path); $img_scaled = imagecreate($new_width, $new_height);...
2
by: Robin Becker | last post by:
Has anyone done transparency with PIL & TIFF? I'm using PIL to generate a preview TIFF for embedding into an eps file and am being asked for the TIFF to support transparency. -- Robin Becker
3
by: Mr. x | last post by:
Hello, I would like that my image's background color will be transparent. What I have is only paintbrush. My image is *.jpg format (I have tried to save it as *.gif format, and I got less...
20
by: Nathan Sokalski | last post by:
I am trying to create graphics with GDI+ that include transparency. However, the transparency never seems to show up, even though my colors have an alpha value of 0. How can I generate a graphic...
6
by: tommaso.gastaldi | last post by:
In a previous post I have been asking about a way to test Alpha Transparency. Bob and Michael have kindly provided some ideas. Here I would like to share the function I have prepared, for the...
0
by: ZikO | last post by:
Hi. I've experienced one problem. Im using three froms. Two of them are maximized, whereas one is normal form with transparency. Transparency stops working, that is I can see the color which...
1
by: dragze | last post by:
Hi, On one of the pages of my site i use two javascripts, one makes transparency of png's work in IE, and the other embeds a flash player. Now use one of the scripts it works fine, use both and...
3
by: Martijn Mulder | last post by:
When I populate a ToolStrip with ToolStripButtons with a .png-image on it, will Windows understand the transparency of the .png file?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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...

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.