|
-
Oct 26th, 2002, 03:32 PM
#1
Thread Starter
Lively Member
The mysterious .ZOrder [RESOLVED]
I have figured out that a control's order (objects with higher order are displayed above all subordered controls) can be manipulated to some extent with the .ZOrder command.
VB Code:
Command1.ZOrder (0) ' brings forth
Lets say that you have a text box placed over a command box, and because the text box is of 'higher order', you cannot see the command button. The above code will bring it forth above the textbox.
VB Code:
Command1.ZOrder (1) ' sends back
This works in a simple example as in the one I gave above. But when implemented into a more complex situation, it doesn't seem to work. I have my control in the correct container, and is visible etc. Can somebody ******** this .ZOrder command.
VB Code:
For X = 1 To Form1.Count
Label9.ZOrder (0)
Next X
' This doesnt not work :(
Last edited by Daniel McCool; Oct 26th, 2002 at 03:49 PM.
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Oct 26th, 2002, 03:35 PM
#2
PowerPoster
Labels are not really windows, and therefore you cannot draw them ontop of other controls. The way VB interprets them is to check where the user drew it on the the form or container, then use the "Print" statement to just print the caption on the form or container wherever you drew the label. This way, it will always be behind everything else no matter what zOrder you give it.
-
Oct 26th, 2002, 03:35 PM
#3
Labels are lightweight controls and because of the they will always fall behind other controls. Especially labels and Image controls, because they are actually drawn right onto the form, rather than being actual windows themselves.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 26th, 2002, 03:40 PM
#4
Thread Starter
Lively Member
If I were to change my Label control to a Text box, would I be able to change the container of my Text box elsewhere and have it displayed ( possibly with .ZOrder)?
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Oct 26th, 2002, 03:42 PM
#5
Yup, to change the container...
VB Code:
Set Text1.Container = Frame1
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 26th, 2002, 03:42 PM
#6
If you are "layering" controls so that only one can be seen at a given time, you are better off just setting their Visible property to True or False.
-
Oct 26th, 2002, 03:49 PM
#7
Thread Starter
Lively Member
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|