473,386 Members | 1,819 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.

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 10935
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: 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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
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...

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.