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

Transparent attribute for labels

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

Sep 25 '06 #1
8 2113
Off the top of my head, I would not use controls like that because of the
overhead. I would look into graphic reagions and then during the mouse down
event change the cursor based on if the x y coordinate is within one of the
regions.
======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
"MikeB" wrote:
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

Sep 25 '06 #2
OK, I'm not the sharpest knife in the drawer, but are you telling me
that causing a continuous interrupt stream generated by Mousedown and
then the program work to map the x,y location to the region of a
hotspot is less work than the isolated event that occurs when the user
clicks on the hotspot?

The way I'm trying to do it seems to be a LOT less coding. All that I'm
having difficulty with is the Transparent attribute for BackColor.

Mike

dotNetDave wrote:
Off the top of my head, I would not use controls like that because of the
overhead. I would look into graphic reagions and then during the mouse down
event change the cursor based on if the x y coordinate is within one of the
regions.
======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
"MikeB" wrote:
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
Sep 25 '06 #3

MikeB wrote:
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
When you place the label on the PictureBox, the label parented to the
form. If you set the label's parent to the PictureBox, then using a
backcolor of transparent will work.

Sep 25 '06 #4

Chris Dunaway wrote:
MikeB wrote:
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

When you place the label on the PictureBox, the label parented to the
form. If you set the label's parent to the PictureBox, then using a
backcolor of transparent will work.
That must be my problem! Can you please tell me how I change or control
the parentage of the control?

Thanks so much
Mike

Sep 25 '06 #5
MikeB wrote:
That must be my problem! Can you please tell me how I change or control
the parentage of the control?
Just use a line like this:

label1.Parent = PictureBox1

Sep 26 '06 #6

Chris Dunaway wrote:
MikeB wrote:
That must be my problem! Can you please tell me how I change or control
the parentage of the control?

Just use a line like this:

label1.Parent = PictureBox1
Thank you again. That was really helpful.

PS. I'm kinda new to the VB scene

Sep 27 '06 #7
Just a warning, I have seen the transparency of controls not work with some
video cards, that's why I use regions instead.

David
"MikeB" wrote:
OK, I'm not the sharpest knife in the drawer, but are you telling me
that causing a continuous interrupt stream generated by Mousedown and
then the program work to map the x,y location to the region of a
hotspot is less work than the isolated event that occurs when the user
clicks on the hotspot?

The way I'm trying to do it seems to be a LOT less coding. All that I'm
having difficulty with is the Transparent attribute for BackColor.

Mike

dotNetDave wrote:
Off the top of my head, I would not use controls like that because of the
overhead. I would look into graphic reagions and then during the mouse down
event change the cursor based on if the x y coordinate is within one of the
regions.
======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
"MikeB" wrote:
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
>
>

Oct 2 '06 #8
This is driving me crazy. I could swear I had this to work and since
last night when I try it out in my project, it again fails!

If I have the image on the background of the form, I can create a
transparent label whee the cursor changes.

If I put the image in a picturebox and place the label over it, I get
the blank label overlaying the image. If I then in the load event for
the form code

label.parent = picturebox

Then the label box disappears from the screen and I can't mouse over
it, but I can see the image just fine. Ack! What am I overlooking that
made it stop working since last week?

I've tried Send to back and Bring to front, but that doesn't seem to
have any effect, both from the designer and program-wise.

I've got such an important part of my project hinging on this and I've
kinda misplaced the working sample I had last week, I'm in real
trouble.

dotNetDave wrote:
Just a warning, I have seen the transparency of controls not work with some
video cards, that's why I use regions instead.

David
"MikeB" wrote:
OK, I'm not the sharpest knife in the drawer, but are you telling me
that causing a continuous interrupt stream generated by Mousedown and
then the program work to map the x,y location to the region of a
hotspot is less work than the isolated event that occurs when the user
clicks on the hotspot?

The way I'm trying to do it seems to be a LOT less coding. All that I'm
having difficulty with is the Transparent attribute for BackColor.

Mike

dotNetDave wrote:
Off the top of my head, I would not use controls like that because of the
overhead. I would look into graphic reagions and then during the mouse down
event change the cursor based on if the x y coordinate is within one of the
regions.
======================================
David McCarter
www.vsdntips.com
VSDN Tips & Tricks .NET Coding Standards available at:
www.cafepress.com/vsdntips.20412485
>
>
"MikeB" wrote:
>
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
Oct 3 '06 #9

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

Similar topics

4
by: DS | last post by:
Anyone know of any downsides of using Transparent Buttons with Labels behind them? Thanks DS
2
by: Steve Barnett | last post by:
I've got a form on which there is a picture box with a picture in it. On top of that I place two labels and make their backgrounds transparent. What I expect to see is the picture showing through...
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 ...
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: Pascal | last post by:
Je veux que mes label soit transparent aussi sur mes picturebox alors j'écris : i want my labels to be transparent on my pictureboxes so i wrote : Private Sub Form1_Load(ByVal sender As Object,...
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...
3
by: T Clancey | last post by:
Hi all. I've been working on a small and very simple label design app for a few days now, I've got most of my problems solved, although I'm sure there are some more just around the corner! ...
1
by: FPhoenix | last post by:
Ive been Developing a program in VB.NET after an extensive break from VB6. In this application i have an image that gets loaded through a listbox, on this image there are areas on the various...
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: 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:
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
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...
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.