473,785 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByVa l sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Label1.Parent = PictureBox1
Label1.BackColo r = Color.Transpare nt
Label2.Parent = PictureBox2
Label2.BackColo r = Color.Transpare nt
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 3659
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(ByVa l sender As Object, ByVal e As System.EventArg s)
Handles Me.Load

Label1.Parent = PictureBox1

Label1.BackColo r = Color.Transpare nt

Label2.Parent = PictureBox2

Label2.BackColo r = Color.Transpare nt

Label2.Location = New Point(19, 15)

Label3.Parent = PictureBox2

Label3.BackColo r = Color.Transpare nt

Label3.Location = New Point(110, 15)

Label4.Parent = PictureBox2

Label4.BackColo r = Color.Transpare nt

Label4.Location = New Point(196, 15)

End Sub

Private Sub Form1_Load(ByVa l sender As Object, ByVal e As System.EventArg s)
Handles Me.Load

Label1.Parent = PictureBox1

Label1.BackColo r = Color.Transpare nt

Label2.Parent = PictureBox2

Label2.BackColo r = Color.Transpare nt

Label2.Location = New Point(19, 15)

Label3.Parent = PictureBox2

Label3.BackColo r = Color.Transpare nt

Label3.Location = New Point(110, 15)

Label4.Parent = PictureBox2

Label4.BackColo r = Color.Transpare nt

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
2065
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 behind the labels, but what I actually get is the background of the labels painted in the background colour of the form. Can I have "transparent" labels over a picture box? I've done this many times in my VB days and don't see why it should be...
1
2302
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 clear it and sometimes copy the drawing to the bottom picturebox image or BackgroundImage. Just to see if it would work I set the Background color of the top one to transparent but, rather then seeing the bottom box in the transparent one I...
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?
2
7588
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...
1
8791
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 i need to see whats beind those pictureboxes and at the same time showing, the lines and rectangles that exist on the pictureboxes that are at the top. Because i just can't copy the image to the other picturebox (because i'll have to be able to...
1
3198
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
3969
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...
1
2228
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 images that need to be clickable, very similar to html imagemaps. so after starting the project i was under the assumption that i could still use transparent labels or visible = false labels to activate the click function. however in vb.net, the labels...
8
10178
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 however shows white as the PictureBox moves but I want it to be transparent. The PictureBox BackColor is set to Transparent .. but no affect. I have used PhotoShop to make the image background transparent .. again no affect. If I make the image a...
0
9645
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
9480
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
10325
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
8972
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
7499
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
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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...
1
4050
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
2879
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.