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

Transparent Label

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 documentation has reached
an all-time low (please note the part about the z-order):

MSDN:
In Visual Basic 6.0, the BackStyle property of the Label control determines
whether the label had a transparent background. Setting the BackStyle
property to 0 - Transparent allows any background image to show through the
label. If the label is placed over other controls, the controls also show
through.

In Visual Basic 2005, the BackStyle property no longer exists and the
transparency behavior is slightly different (YES, IT DOESN'T EXIST). To
emulate the transparent behavior in Visual Basic 2005, set the BackColor
property to Transparent. This will allow the background image to show
through. If the label is placed over other controls, the controls will show
through only if they are higher in the z-order (Z-ORDER YOU SAID? KEEP
READING!)

Note
The ZOrder method no longer exists in Visual Basic 2005. At design time you
can use the Bring to Front or Send to Back command on the Format menu; at
run time you can use the BringToFront or SendToBack function.

No transparency, No z-order.... What will we do now? The Microsoft solution
is to move the Picture to the front... How many do you think would still be
able to read the label? But ok, we can see the picture... Transparency
"Flintstones Style" ;-)

Feb 16 '06 #1
2 10941
Hi,

When you set the backcolor of a control to transparent it will take
it parents background. So if your label is over a picturebox and its parent
is the form the forms background will show. So add the control to the
picturebox's controls collection.

Ken
-----------------------------

"Martin" wrote:
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 documentation has reached
an all-time low (please note the part about the z-order):

MSDN:
In Visual Basic 6.0, the BackStyle property of the Label control determines
whether the label had a transparent background. Setting the BackStyle
property to 0 - Transparent allows any background image to show through the
label. If the label is placed over other controls, the controls also show
through.

In Visual Basic 2005, the BackStyle property no longer exists and the
transparency behavior is slightly different (YES, IT DOESN'T EXIST). To
emulate the transparent behavior in Visual Basic 2005, set the BackColor
property to Transparent. This will allow the background image to show
through. If the label is placed over other controls, the controls will show
through only if they are higher in the z-order (Z-ORDER YOU SAID? KEEP
READING!)

Note
The ZOrder method no longer exists in Visual Basic 2005. At design time you
can use the Bring to Front or Send to Back command on the Format menu; at
run time you can use the BringToFront or SendToBack function.

No transparency, No z-order.... What will we do now? The Microsoft solution
is to move the Picture to the front... How many do you think would still be
able to read the label? But ok, we can see the picture... Transparency
"Flintstones Style" ;-)

Feb 16 '06 #2
Ken,

Thanks a lot! It works like a charm! I achieved this by opening the
MyForm.designer.vb file and change the following line:

Me.Controls.Add(Me.lblHeader)

into:
Me.PictureBox1.Controls.Add(Me.lblHeader)

But that was in the code marked with:
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.

How do you modify a controls parentage with the designer?

Tia,
Martin

"Ken Tucker [MVP]" <Ke**********@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
Hi,

When you set the backcolor of a control to transparent it will
take
it parents background. So if your label is over a picturebox and its
parent
is the form the forms background will show. So add the control to the
picturebox's controls collection.

Ken
-----------------------------

"Martin" wrote:
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 documentation has
reached
an all-time low (please note the part about the z-order):

MSDN:
In Visual Basic 6.0, the BackStyle property of the Label control
determines
whether the label had a transparent background. Setting the BackStyle
property to 0 - Transparent allows any background image to show through
the
label. If the label is placed over other controls, the controls also show
through.

In Visual Basic 2005, the BackStyle property no longer exists and the
transparency behavior is slightly different (YES, IT DOESN'T EXIST). To
emulate the transparent behavior in Visual Basic 2005, set the BackColor
property to Transparent. This will allow the background image to show
through. If the label is placed over other controls, the controls will
show
through only if they are higher in the z-order (Z-ORDER YOU SAID? KEEP
READING!)

Note
The ZOrder method no longer exists in Visual Basic 2005. At design time
you
can use the Bring to Front or Send to Back command on the Format menu; at
run time you can use the BringToFront or SendToBack function.

No transparency, No z-order.... What will we do now? The Microsoft
solution
is to move the Picture to the front... How many do you think would still
be
able to read the label? But ok, we can see the picture... Transparency
"Flintstones Style" ;-)

Feb 16 '06 #3

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

Similar topics

3
by: SStory | last post by:
Is there no way to make a label or link label transparent in vb.net? This is a real pain on about screens with nice graphics where you want your text backgroup to be transparent. I can...
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 ...
1
by: Dean Slindee | last post by:
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...
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: 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: bulwark_jrm | last post by:
I'm trying to duplicate functionality found in a Windows application at one of my clients. Essentially, another programmer was able to arrange a lot of search options into a single dialog box by...
3
by: vul | last post by:
I used to use creating headers (label at the top of the screen) for VB6 forms as 2 labels shifted a little bit with different for colors to get a simulation of a shadow. I set BackColor of both...
8
by: MikeB | last post by:
Hi, I created a picturebox with a map as an image. I want to make certain areas on the map clickable hotspots and the way I'm trying to do this is to create a transparent label with a different...
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
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...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.