|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
transparent labels on pictureboxesj'é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 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 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
Adding row to table
XY coordinates on form Calling forms from a Form years,months,days XML Encoding woes... renameing Visual basic 2005 express projects "Key not found" Exception Assigning to DataSource Property of Grid Attempted to read or write protected memory. dll vs vb 2005 aspnet vb webproject Too much code in Form |
|||||||||||||||||||||||