Results 1 to 7 of 7

Thread: How to disable a MDIChild from going behind already open another MDIChild form?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2017
    Posts
    12

    How to disable a MDIChild from going behind already open another MDIChild form?

    Hi, I am working on a project in Visual Basic 6.0. To make it easier for readers to understand, I will explaining my issue this way:
    I have two MDIChild forms. First MDIChild form shows the list of all customer bills in Datagrid (connected to MSAccess DB) and when a button is clicked on this form then Second MDIChild form shows the actual bill(print copy that is handed over to customers). So what I want is that when Second MDIChild form is loaded in front of First MDIChild form, then Second form should not go behind the first form when a click is performed anywhere on First MDIChild form. Second form should remain in front.
    I hope my issue is easily understandable now.
    Please help.
    Thank you

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    In that case the 2nd form should be a normal form and show it modally.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2017
    Posts
    12

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    Thanks for replying Arnoutdv. I am not able to understand anything. Can you explain in detail?

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    The Second MDIChild form: Make it a normal form instead of a MDIChild.
    When you click the button on the First MDIChild form show it as:
    Code:
    ' Assume your form is named frmActualBill
    frmActualBill.Show vbModal

  5. #5
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    or make the 2nd form a normal form (not an mdichild) , but owned by the mdiform
    Code:
    Form2.Show , MDIForm1
    do not put off till tomorrow what you can put off forever

  6. #6
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,084

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    on second thought, i would just use 2 mdichildren, and let the user do what s/he wants
    after all, the user can always move the 2nd form out of the way
    even beyond the borders of the mdiform, wich then would show its scrollbars
    do not put off till tomorrow what you can put off forever

  7. #7
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: How to disable a MDIChild from going behind already open another MDIChild form?

    In the first form you can put this code:
    Code:
    Private Sub Form_Activate()
        SecondForm.ZOrder
    End Sub
    The problem is that the user won't be able to do much in the first form doing that, specially with the keyboard.

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