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 :wave:
Printable View
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 :wave:
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:
With SysInfo1 Me.Move .WorkAreaLeft, .WorkAreaTop, .WorkAreaWidth, .WorkAreaHeight End With
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. :)
Thank you! That is a very useful function, just what I need. Thanks for all your help.