473,760 Members | 10,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "Transparen t" 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
"Flintstone s Style" ;-)

Feb 16 '06 #1
2 10986
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 "Transparen t" 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
"Flintstone s 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**********@d iscussions.micr osoft.com> wrote in message
news:12******** *************** ***********@mic rosoft.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 "Transparen t" 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
"Flintstone s Style" ;-)

Feb 16 '06 #3

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

Similar topics

3
5133
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 drawstring most of it--shouldn't have to. But how to do the linklabel I don't know--other than using the control. Ideas? solutions?
4
2563
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 lblP1JoyRight.BackColor = clrLabelMove
1
8352
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 String For Each ctl In Me.Controls
2
7587
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 form are made transparent. What results is the label's backcolor appearing as blocks of 'control' colored background. Setting the label's backcolor to color.transparent does not make it transparent (evidently the text is repainted with a...
2
2066
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 (backcolor = color.transparent) what it shows is the window, not the control behind it. What am I doing wrong? TIA - Jeff
3
3206
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 positioning the descriptive label behind the textbox instead of beside it. When the user enters text, the label disappears and the user types in their information into the textbox. I've figured out how to arrange a label behind the textbox...
3
3966
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 labels to Transparent. Everything works fine. I'm trying to use the same approach with VB 2005 windows forms. Although I'm setting labels backcolors to transparent, it is not transparent and the label located behind is not visible. I tried to...
8
2150
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 cursor (hand) and then I code the click_event for that label. However, I cannot make the label transparent, even if I choose the Transparent option for the attribute for the background color of the label. Any ideas or suggestions? Thanks
0
9521
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9333
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7324
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.