Results 1 to 4 of 4

Thread: Event 'form.move' --> this is tricky....

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    -
    Posts
    10

    Exclamation


    Hi everyone,

    I was wondering if there is an event which handles like a 'form.move'. I'd like to make one form 'dock' to another form, but

    - I don't know when Form1 is moving/moved, so:
    - I ALSO don't know when to move Form2 by code...

    Does anyone has a solution to this problem?

    Thanx in advance!

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    If you are docking forms you might want to look at the API for SetWindowPosition...then you just call your forms to their preordained positions.

    http://www.vbapi.com/ref/s/setwindowpos.html



    [Edited by HeSaidJoe on 08-01-2000 at 06:12 PM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    -
    Posts
    10

    Question


    Thanx, but I think this piece of code is not doing the thing I want. I'll explain:

    I Have A Form, "Form1" with properties:
    Width=1000
    Left=2000

    I have another Form, "Form2" with properties:
    Width=1000
    Left=Form1.left + form1.Width

    Now, if I move "Form1", "Form2" aslo has to move!
    But since there is no event on moving Form1, this isn't possible!!

    Solution?

    Anyone?

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'form 1 code
    
    Private Sub Form_Load()
    
        Dim x As Integer, y As Integer, _
        z As Integer
        
        x = 100
        y = 200
        z = 3000
        
        Form1.Width = z
        Form2.Width = z
        Form1.Left = y
        Form2.Left = (y + Form1.Width)
        Form1.Top = x
        Form2.Top = x
        
        
        Load Form2
        Form2.Show
    
    End Sub
    
    'form 2 code
    'command button on form2
    
    Private Sub Command1_Click()
        Form1.Move (4000)
        Form2.Move (4000 + Form1.Width)
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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