How to force "bring to front"  with more then 1 frame on a form

Posted on 2009-04-28
Last Modified: 2012-06-27
I have 4 frames on a form , during design time they all have set property "bring to front"is true.

When I move one off the frames on the form to another position on that form,   and it reaches on teh form the position of a other frame wich has a "higher"  rang in being "at front" the frame I move will move under that frame, on a fram wich has a lower "rang" it will on top off that frame.

How to get a situation that any frame wich gets status     MouseDown(Button_.......  at mouse click will have the first status in being  "bring to front" so it allways be the frame on top off the other frames
Question by:BIAPRO
    LVL 11

    Expert Comment

    Assuming this is VB6, use the ZOrder property, ie:

        Frame1.ZOrder 0 'Bring to front
        Frame2.ZOrder 1 'Send to back
    LVL 11

    Accepted Solution

    Oh, and if you prefer, you can use the vbBringToFront & vbSendToBack constants in place of the 0 & 1.

        Frame1.ZOrder vbBringToFront 'Bring to front
        Frame2.ZOrder vbSendToBack 'Send to back

    Author Closing Comment

    great!  works perfect, thanks
    LVL 11

    Expert Comment

    Glad to have helped :-)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now