-
Hi,
I'm developing an OCX (a Command Button).
Then I create the Button.ocx and put it in a Form to test it.
When I put a Label over my OCX, the Label stays "behind" of it.
How can I avoid this? I need the Label over the OCX, like when we put a Label over a Picturebox...
Is there any property that I should set up to solve this?
I already spent a lot of time and didn't get any solution...any ideas are welcome.
Thanks for any help...
Michel Jr.
-
Unfortunately, I think you cannot do that. As MSDN states: There are 3 layers associated with Forms and Containers. The Back layer is the drawing space, the Middle layer is for Graphical Controls and the Label, and lastly, the Front layer is for Non-graphical Controls such as the CommandButton, CheckBox, OptionButton etc.
Your OCX Control is in the Front layer, therefor, it will be covering the Label regardless of the ZOrder because the ZOrder will only affect the object's in the same layer of the object you specify.
-
There's two ways out of it:
Either use somethings instead of labels, ie, pictureboxes to draw text on
or,
To make your usercontrol Windowless, like image control and label it self
-
A PictureBox uses up a lot of Resources. Your second approach seems more reasonable.
-
Yes, i agree but I have Vb5, and it wont support it.