Results 1 to 4 of 4

Thread: arrange

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    arrange

    Hi my friends,
    I'm Iranian & i do apology for bad spell in this text.
    my problem is this:
    I work by Visual Basic 6
    I have one Mdi Form & many Child Form in my project
    when we open the forms in the Mdi form, each form open in the specific position & this window is very tidy,
    my problem is start when we are to close this window,
    when we are to close all of this child form, when we open one child form again, this form don't display in "left=0","top=0" position,
    This is display & open below last position of last window that open before close all window.
    arrange function solve this problem for short time, but i can not use this function before open each window, because i want that users can be change the window's position by their desire.
    I need to function that can change the position (Left & top) to the 0,0
    after close all child form & after doing arrange 0
    & one function that can change the position to the left+100 & top+100 than the last form that is open now in the Mdi Form.
    please help me...


    when open windows for first time:


    when open windows for second time:


    when open windows for third time & after use arrange 0 & after this open the fourth form:


  2. #2

  3. #3

  4. #4
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: arrange

    Based upon a single global variable that keeps track of how many child forms you have open...
    Code:
    Private Sub Form_Load()
    Me.Left = MyGlobalVariable * 300 'tweak these values...
    Me.Top = MyGlobalVariable * 300
    MyGlobalVariable = MyGlobalVariable + 1
    End Sub
    
    Private Sub Form_Unload()
    MyGlobalVariable = MyGlobalVariable - 1
    End Sub

    Good Luck
    Option Explicit should not be an Option!

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