Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid the Label stays "behind" my Command Button?

Status
Not open for further replies.

MichelJunior

Programmer
Jul 2, 2000
2
BR
Hi, <br><br>&nbsp;&nbsp;&nbsp;I'm developing an OCX (a Command Button), called Button.ocx <br>&nbsp;&nbsp;&nbsp;Then I create the Button.ocx and put it in a simple Form to test it. When I put a Label over this Button, the Label stays &quot;behind&quot; of it. <br>&nbsp;&nbsp;&nbsp;This is the second OCX that I developed and both have this problem.<br>&nbsp;&nbsp;&nbsp;My OCX is composed only by the UserControl.<br><br>&nbsp;&nbsp;&nbsp;How can I avoid this? I need the Label stays over the Button...<br>&nbsp;&nbsp;&nbsp;Is there any property that I should set up to solve this?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks for any help... <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Michel Jr.
 
You need to set the zOrder of the button and the OCX<br><br>object.Zorder position <br><br>or in design time place both the controls on the form and select the UserControl and from the Format menu select&nbsp;&nbsp;&nbsp;&nbsp;order and then bring to front <br><br><br>hope this helps <br><br>
 
I have run into the problem only with labels.<br>no matter what you set the zorder to the label is allways behind everything else.<br><br>what I did was the eather move the label or to only display the 'button' or the label.<br><br>example, <br>public sub Lblbutton_click() <br>Cmdbutton.visable = true<br>cmdbutton_click<br>end sub<br><br>it is crude but it works.<br> <p> <br><a href=mailto:trbrenke@yahoo.com>trbrenke@yahoo.com</a><br><a href= autocad and visual basic</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top