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

transparent labels on pictureboxes

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, ByVal e As System.EventArgs)
Handles Me.Load
Label1.Parent = PictureBox1
Label1.BackColor = Color.Transparent
Label2.Parent = PictureBox2
Label2.BackColor = Color.Transparent
End Sub

ça marche nickel pour label1 mais pas pour label2....
it works fine for label1 but not for label12

Pourquoi ? J'ai fait exactement la même manip...
why ? I did the same thing for the two labels...

someone has got an idea ?
thanks
pascal
Jun 4 '06 #1
2 3618
ag
Put these lines after your mentioned code:

Label1.Location=New Point(1,1)
Label2.Location=New Point(1,1)

Then you can see your labels. :)

The problem was, when u r assigning a label to new parent, it will
calculate some relative position depending on the label's previous
parent's Location i.e. the Form itself. Surprisingly the labels were
there and u coudnt see it becoz ur picturebox is small. Resize ur both
picture box to big, then u can see ur labels OR u assign label to new
location (i.e. 1,1 or anything ) RELATIVE TO picturebox i.e. its new
parent.

Regards,
ag

Jun 4 '06 #2

woah you did it !!!!!! i spent a lot of time about this.... suspecting a bug
around png file etc.... aaargh!
now it's perfect ! thanks to be so fast !

here is the code
:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Label1.Parent = PictureBox1

Label1.BackColor = Color.Transparent

Label2.Parent = PictureBox2

Label2.BackColor = Color.Transparent

Label2.Location = New Point(19, 15)

Label3.Parent = PictureBox2

Label3.BackColor = Color.Transparent

Label3.Location = New Point(110, 15)

Label4.Parent = PictureBox2

Label4.BackColor = Color.Transparent

Label4.Location = New Point(196, 15)

End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

Label1.Parent = PictureBox1

Label1.BackColor = Color.Transparent

Label2.Parent = PictureBox2

Label2.BackColor = Color.Transparent

Label2.Location = New Point(19, 15)

Label3.Parent = PictureBox2

Label3.BackColor = Color.Transparent

Label3.Location = New Point(110, 15)

Label4.Parent = PictureBox2

Label4.BackColor = Color.Transparent

Label4.Location = New Point(196, 15)

End Sub

http://www.scalpa.info
Jun 4 '06 #3

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

Similar topics

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...
1
by: active | last post by:
I have a UserControl that contains two pictureboxes. One on top of the other. The top one is smaller then the bottom one. The top one is to be transparent. I want to draw on it and then sometimes...
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...
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...
1
by: Ricardo Furtado | last post by:
in my app i must have several pictureboxes over the others. Some pictureboxes just have a couple of lines or rectangles, and absolutly nothing more but the image is an .BMP. So, my problem is that...
1
by: Rohan | last post by:
Hi There, Is it possible to rotate or resize pictureboxes, labels, textboxes at runtime? And I even wanted to make textbox and label controls Transperent ?
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...
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...
8
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
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: 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?
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
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
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,...
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.