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

Transparent Label on a Panel with Paint

Hi,

I use paint event to draw gradient on a Panel.
But how to get the label to be transaparent on a gradient draw Panel?

Thank you.

Regards,
Daniel


Nov 16 '05 #1
2 8893
Hi Daniel,

Set the label's BackGroundColor = Color.Transparent

If you use ClipRectangle for your gradient calculation the gradient for the label will be different than the background.

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Hi Morten,

I've tried the transparent for backcolor, but it doesn't work.
The below is the coding to draw the gradient. Could that be other way of
writing?
System.Drawing.Drawing2D.LinearGradientBrush brush = new
System.Drawing.Drawing2D.LinearGradientBrush(new
System.Drawing.RectangleF(0,0, this.Width, this.Height), Color.Blue,
Color.SkyBlue, System.Drawing.Drawing2D.LinearGradientMode.Vertic al);

graphics g = this.CreateGraphics();

g.FillRectangle(brush, new RectangleF(0,0,this.Width, this.Height));

g.Dispose();
Thank you.
Regards,
Daniel
BCE Software Sdn Bhd
"Morten Wennevik" <Mo************@hotmail.com> wrote in message
news:opsb47fet8klbvpo@morten_x.edunord...
Hi Daniel,

Set the label's BackGroundColor = Color.Transparent

If you use ClipRectangle for your gradient calculation the gradient for the label will be different than the background.
--
Happy coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #3

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

Similar topics

4
by: Adam Maltby | last post by:
Hi, I need to do a transparent label but with a difference. I have drawn on my form a custom background using CreateGraphics as I needed an ellipse looking fill in a rectangle - so the actual...
2
by: Dean Slindee | last post by:
It appears that I have two routines that don't play well together! First routine: a form's background is shaded with a gradient color. Second routine: then, the background of all labels on the...
2
by: Peteroid | last post by:
When the application I'm working on is run it creates a panel with a Paint event customized to draw primitives (circles, rectangles, etc.), places the panel on a form, and then launches the form....
1
by: choffi | last post by:
Hi, I have a problem which, having looked through various previous postings, I notice that others have also come across. The problem I have as follows: I have incorporated an external...
3
by: melanieab | last post by:
Hi, I'd like to put a transparent label over a textbox. I set the label backcolor to transparent, and set its parent as the textbox. But setting the textbox as the parent resulted in the label...
5
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
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...
4
by: Rishabh Indianic | last post by:
i am developing smart phone application with VS 2005 using C#. i am trying to transparent the background of link label control which dynamically added in panel. i try with following code to...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...

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.