473,397 Members | 2,099 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,397 software developers and data experts.

How to set a label's backcolor to transparent?

The code below runs in the form_paint event but changes nothing, anyone got
a better idea or why this code is not effective?

Imports System.Drawing.Drawing2D

Dim ctl As Control

Dim str As String

For Each ctl In Me.Controls

str = ctl.GetType.ToString

If str = "System.Windows.Forms.Label" Then

ctl.BackColor = System.Drawing.Color.Transparent

End If

Next

Thanks,

Dean Slindee
Nov 21 '05 #1
1 8240
The Transparent will set the control to be transparent with respect to its
parent
So Incase of the label, it will become transparent for the Form and if the
form has a background image will show through the label.
But the lable cant be transparent for other controls.
In case you want some heirarchial transparency, then you can manoeuvr the
parent/child relationships of the controls to do this.

HTH
rawCoder

"Dean Slindee" <sl*****@charter.net> wrote in message
news:ys************@fe06.lga...
The code below runs in the form_paint event but changes nothing, anyone got a better idea or why this code is not effective?

Imports System.Drawing.Drawing2D

Dim ctl As Control

Dim str As String

For Each ctl In Me.Controls

str = ctl.GetType.ToString

If str = "System.Windows.Forms.Label" Then

ctl.BackColor = System.Drawing.Color.Transparent

End If

Next

Thanks,

Dean Slindee

Nov 21 '05 #2

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

Similar topics

4
by: Efkas | last post by:
Hi, I had some label with BackColor.Transparent and a User Control also with transparent background. When I put a label on the user control, instead to have transparent result I obtain a...
0
by: Peter Oliphant | last post by:
I'm trying to make my Label's transparent. According to the documentation, setting the Label's BackColor property to Color::Transparent should do this. However, all it seems to do is change the...
9
by: SStory | last post by:
I have a picturebox in my About form. would like to have a link to my company website. Wanted the links background to be transparent. It seems that no one knows how to do this. Have asked...
2
by: UJ | last post by:
I have a browser object on a form with a label in front of it. I want the label to be transparent so that you can see what's going on in the browser behind it. When I make the label transparent...
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...
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...
0
by: VorTechS | last post by:
I'm having a problem with an inherited label, applying text rotation to aligned text. If text rotation is applied to the aligned text, the alignment goes 'nuts'. I can find no logic to what is...
5
by: Brian S. | last post by:
Hi, Is there a way to make the lable background transparent? I though I was about to do this in Access 2.0... but its been a few years... Brian
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: 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: 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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.