Results 1 to 7 of 7

Thread: The mysterious .ZOrder [RESOLVED]

  1. #1

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127

    Lightbulb 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:
    1. 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:
    1. 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:
    1. For X = 1 To Form1.Count
    2.             Label9.ZOrder (0)
    3.         Next X
    4.        ' 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

  2. #2
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    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.
    <removed by admin>

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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

  4. #4

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127
    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

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Yup, to change the container...
    VB Code:
    1. Set Text1.Container = Frame1

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6

  7. #7

    Thread Starter
    Lively Member Daniel McCool's Avatar
    Join Date
    Oct 2002
    Posts
    127
    Thanks fellas. It works.
    "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
  •  



Click Here to Expand Forum to Full Width