473,320 Members | 1,946 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,320 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 10928
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.