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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to work with zOrder of controls on a form? 1

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
Right now I'm having the problem that once I set the zOrder of an object on my form, I am unable to go back and reference it. I.ee I'd like to set the zOrder of one object to the same zOrder as another object.

Maybe I'm on the wrong track with zOrder. Is there a way I can place objects in front of each other in relation to other objects?

Any leads or suggestions to other ways of doing this are most welcome!

Thanks for your time!

Take Care,
Mike
 
I think you are getting confused with zorder (though be careful here because I have not got VB available right now to be able to confirm what I am saying...). Zorder is actually a method, which essentially either brings right to the very front, or right to the very back. There are no shades of grey.

What you could perhaps do is think about putting your controls inside a container control such as a frame, and then playing with the ZOrder on that. I don't know your application though, so perhaps that's not suitable.

mmilan
 
Ya, zOrder seems to be a method that exists for a control, not a property. Unfortunately I need to have all my shape controls in a container that has a transparent background. Can that be done in a frame?

Take Care,
Mike
 
Is there a way to manage the order of the shape controls within the frame? I'm not worried about getting the shapes in front of my other cotrols, as much as how they relate to each other, and putting some behind others (yet keep them in front of other controls as well), and others infront of other shapes as needed. Can this be done?

Take Care,
Mike
 
Hmm...

I suppose you could try iterating through the shape controls, starting with what should be the furthest back, and ending at the control you want at the front, using the zorder method to bring them to the front as you go.

That might achieve what you're looking for.

In terms of a transparent frame, the standard control certainly doesn't support transparency - though you could easily write a similar control in VB that would.

mmilan
 
Yes, I might have to resort to that. I was hoping to avoid that, since that would cause component nesting, but I'll give it a go and see if it works.

Cheers, and thanks for your help :).

Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top