Results 1 to 4 of 4

Thread: [RESOLVED] SetParent

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    122

    Resolved [RESOLVED] SetParent

    How would I got about setting the length and width of my form to the window that I am setting to it and making sure that window is centered and fit just right? Thanks for any help

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: SetParent

    Simplest is maximizing the form.

    Next option is Me.Move 0, 0, Screen.Width, Screen.Height but that doesnt take into account the taskbar.

    Another alternative is to use the Sysinfo control to get the workarea (desktop area less taskbar)

    VB Code:
    1. With SysInfo1
    2.       Me.Move .WorkAreaLeft, .WorkAreaTop, .WorkAreaWidth, .WorkAreaHeight
    3.    End With

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    122

    Re: SetParent

    Thanks leinad31, but I didn't mean the whole screen I meant making the window that I am setting to my form. Also, thanks ZenDisaster, that centered it perfectly . I've tried messing around but I think I lack the required knowledge of API to know how to do this. Is there anway to get the form to fit to the window? Heres a ss of what I mean:
    http://img134.imageshack.us/img134/245/frmfitis1.jpg

    Of course, I did that manually by hand, but is there anyway I could achieve that automatically with coding? Thanks for any help, i'm learning a lot.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    122

    Re: SetParent

    Thank you! That is a very useful function, just what I need. Thanks for all your help.

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