Click here to Skip to main content
15,915,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorry for my poor english.
I try to set my transparent Textbox or Label backcolor when it infront of Picture Box or another Object. but it not effect.


My using code :

Me.textbox1.parents = PictureBox1
Me.label1.parents = PictureBox1
Posted
Comments
TryAndSucceed 5-Sep-13 17:34pm    
Can you please make me correct? Are you trying to make your textbox or label "transparent" whenever its infront of a Picture Box/Object? Can you explain your situation or requirement here?
msymarina 5-Sep-13 17:44pm    
i am trying to make the back color of Label transparent only : Me.label1.parents = PictureBox1

1 solution

You're not understanding how controls work. "Transparent" isn't transparent. All it does is tell the control to inherit the background properties of the contain that the control is sitting it. You cannot put a "Transparent" label control over a PictureBox and expect to see the image in the PictureBox. It doesn't work that way.

The is because when a control is rendered on screen it "owns" the pixels that the control covers. Other controls cannot render themselves into pixels that they don't own. That's why you can't see any controls "through" another control on top of it.

There is, however, ways around that.

See this article[^] for an example on how to create a new control to get around this problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900