LOFRANK Posted July 28, 2004 Posted July 28, 2004 when i put a label on a panel witch have a background image , i put the background color of the label Transparent for see just the text on the panel, but it show the background of the form, how to fix? Quote live any day of your life like your last.
ThePentiumGuy Posted July 29, 2004 Posted July 29, 2004 Try putting the panel on top of the label. I think it's becuase the label is 'blocking' the panel. Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Leaders Iceplug Posted July 31, 2004 Leaders Posted July 31, 2004 You can't make the background of a label transparent. You need to draw the text manually using the System.Drawing.Graphics :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Leaders snarfblam Posted August 4, 2004 Leaders Posted August 4, 2004 When the background of a label is set to transparent, the labels CONTAINER is drawn behind the transparent label, but no other controls. If you can see through the label to the form, perhaps the label isnt INSIDE the panel, NOT ON TOP. If this is the case then the form will be drawn through the label, but not the panel (it will look like the label cuts a hole in the panel). You DO NOT need to draw the text manually (everyone seems to think otherwise). You just need to make sure that the control is actually inside what you want to show through the transparent control. If what you want to appear behind the transparent label is not a control container (and a panel IS a control container) and you can't substitute a control container control for what you are using, then in that case, YES, you do need to do it manually with the Graphics class. Quote [sIGPIC]e[/sIGPIC]
*Experts* DiverDan Posted August 4, 2004 *Experts* Posted August 4, 2004 I think that most all controls have a controls properity which you can access and add transparent labels. With Label2 .Location = New Point(20, 20) .BackColor = Color.Transparent .BringToFront() End With PictureBox1.Controls.Add(Label2) BUT...You have a lot more graphic options if the text is directly drawn onto the container control. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Leaders snarfblam Posted August 4, 2004 Leaders Posted August 4, 2004 In VB6, picture boxes could contain other controls. In .NET, the picturebox can not. Only container controls and scrollable controls can contain other controls (for example, panels and group boxes) Quote [sIGPIC]e[/sIGPIC]
*Experts* DiverDan Posted August 4, 2004 *Experts* Posted August 4, 2004 I think if you do a cut and paste with my code you'll be suprised. But...drawing the text directly onto the picture box will afford a lot more options, and is easy enough to do. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Leaders snarfblam Posted August 5, 2004 Leaders Posted August 5, 2004 Surprised indeed. This is contrary to the behavior I expected after reading about container controls in msdn. Quote [sIGPIC]e[/sIGPIC]
*Experts* DiverDan Posted August 5, 2004 *Experts* Posted August 5, 2004 I haven't tried it yet (I prefer to paint text onto objects rather than use transparent labels for many reasons) but I think that since all .NET controls are objects that this should work for all controls. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Leaders snarfblam Posted August 8, 2004 Leaders Posted August 8, 2004 I don't understand what you mean... of course all controls are objects. Everything in .NET derives from the object class. What does that have to do containing other controls? Quote [sIGPIC]e[/sIGPIC]
Engine252 Posted August 14, 2004 Posted August 14, 2004 you could try to override the background painting of the textbox and paint a paece of the background image of the parent object that way you will have that transparent look you might look fore Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.