Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
size of user form
Is there a way of getting a user form in excel to adjust in size to fi
an individuals screen. I have a form that shows up completly on a 17 screen but gets cutoff on a 15" scree -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
size of user form
As far as I know, you'll need to use the Windows API function
GetSystemMetrics32 to get the screen resolution. Also, the units used by UserForm.Move don't seem to be on the same scale as screen resolution - you have to multiply resolution by 3/4. GetSystemMetrics32 declaration and sample code for setting the size of your form are below. Note that this form will cover up your taskbar. You can reduce the height a bit to account for that, but that will assume that the user's task bar is on the bottom of the screen. To truly account for the taskbar, regardless of its position, there is a separate API function called SystemParametersInfo that you'd need to use. This would be more complicated! Declare Function GetSystemMetrics32 Lib "User32" _ Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long Sub ShowMaximizedForm() Dim screenw As Long, screenh As Long screenw = GetSystemMetrics32(0) ' screenwidth in points screenh = GetSystemMetrics32(1) ' screenheight in points UserForm1.Move 0, 0, screenw * .75, screenh * .75 UserForm1.Show End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Form | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
User form | Excel Programming | |||
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form | Excel Programming | |||
User Form | Excel Programming |