+ Reply to Thread
Results 1 to 8 of 8

Zorder Use

  1. #1
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Zorder Use

    I have a user form with a frame control that has some labels, etc. within. I then added a text box to the form (not to the frame) but it is partially hidden behind the frame control. I tried setting the Zorder (textbox1.zorder(0)) when the user form is initialized but it still remains partially hidden by the Frame. Does the Zorder work in VBA?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Zorder Use

    EssoExplJoe

    You are using the wrong language. VBA does not have Zorder property for its ActiveX controls. That applies to InterOp which part of VB.net.

    You have to select the control on the UserForm then use the context menu (Right Click) commands "Bring Forward" or "Send Backward" to change the Z order.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Zorder Use

    Hey Joe,

    Because you are using controls on a Userform, it sounds like you are looking for the Tab Order, which is a property of each control on the userform.

    https://msdn.microsoft.com/en-us/lib...(v=vs.60).aspx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Zorder Use

    I am using controls on UserForms which I don't think are active X. However, I think you are correct i that the Zorder doesn't seem to work for VBA UserForm controls.

  5. #5
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Zorder Use

    No, I am trying to bring a textbox control in front of a frame control which is the zorder, not tab selection order.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Zorder Use

    Listboxes, Frames and Multipages always stay as close to the front of the ZOrder as they can. You can move them relative to other controls of those three types, but not behind a textbox or other control.
    Last edited by xlnitwit; 09-28-2017 at 12:06 PM. Reason: Typo
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Zorder Use

    Hello EssoExplJoe,

    There are only 3 types of control used in Excel: HTML, Forms, and ActiveX. All VBA controls, including the UserForm, are ActiveX controls. The old name these controls was OLE.

    To add to xlnitwit post, the controls he mentions (Frame and Multipage) are known as "containers". These are controls that can host other controls. That is why these will be on top of the UserForm.

  8. #8
    Forum Contributor
    Join Date
    07-23-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    273

    Re: Zorder Use

    Thanks. I had a text box that I wanted to be on top of a user frame but I guess will have to actually put it in the frame.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to set zOrder for datalabels in Chart?
    By Mohanv23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2013, 06:55 AM
  2. [SOLVED] VBA Excel - Textbox disappearing BEHIND listview control - Zorder is useless.
    By Radu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2005, 11:00 AM
  3. Zorder doing strange things
    By Ken Soenen in forum Excel General
    Replies: 5
    Last Post: 12-03-2005, 12:00 AM
  4. ZOrder of two forms
    By OfficeHacker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2005, 04:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1