472,354 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 2035
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.