Results 1 to 4 of 4

Thread: HELP VERY VERY URGENT

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    Please help I am doing it as we speak. How do you get a mdichild form to center on the mdi form? If I click center on owner it gives me an error and same with center on screen. it says invalid propery value. I do have the mdiform starting first and the mdichild is set to true on the form i want to center so Please help!!!

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    Email [email protected]

  2. #2
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    You could center it manually ... ie

    Form1.Left = (MDIForm1.ScaleWidth / 2) - (Form1.ScaleWidth / 2)
    Form1.Top = (MDIForm1.ScaleHeight / 2) - (Form1.ScaleHeight / 2)


    ------------------
    Micah Carrick
    http://micah.carrick.com
    [email protected]
    ICQ: 53480225


  3. #3
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Post

    Create a Procedure called Center in a Module
    Add the following code to it:
    Code:
    Public Sub Center(Child As Form, Parent As Form)
        Child.Top = (Parent.Height - Child.Height) / 2
        Child.Left = (Parent.Width - Child.Width) / 2
    End Sub
    Then, put this in the child form's load event:
    Code:
    Center Me, MDIForm1
    That should help a bit

    ------------------
    r0ach(tm)

  4. #4
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    I think this should do it:

    Form1.Left = (MDIForm1.ScaleWidth / 2) - (Form1.Width / 2)
    Form1.Top = (MDIForm1.ScaleHeight / 2) - (Form1.Height / 2)

    ------------------
    David Underwood
    Teen Programmer

    ICQ - 14028049
    E-mail - [email protected]



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