Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have seen code that basically fits to screen, but I do not believe it would
apply to the UserForm. Maybe somebody smarter than me knows how to write a function that would do that by getting the screen size and setting it to a variable that could be used like maximize. That is about the only solution I can think of right now. I am no good at functions or I would try it for you. "Takashi Yamauchi" wrote: Thank you. But I guess, this doesn't work, because, in your code, you have to know and specify the width and height of UserForm1 beforehand. But I want to maximize UserForm1 as you run the program and irrespective of the size of the display monitor you are using (e.g., desktop, laptop, etc.). So, for example, you wrote an Excel VBA, and give it to your friend. He opens the program. When he opens it, the UserForm1 should be maximized no matter what display monitor he has. But unfortunately, the code you gave me doesn't do that, I guess. So, I guess, what is needed is a procedure that measures the dimensions of the monitor, and feeds the information to UserForm1??? e.g., Userform1.width = DisplayMonitor.width Userform1.height = DisplayMonitor.height Userform1.left = 0 Userform1.top =0... something like that... But thank you anayway. takashi yamauchi "JLGWhiz" wrote in message ... I just created a UserForm for a test. I put the width and height dimensions in the initialize event like this: Private Sub UserForm_Initialize() With UserForm1 .Width = 640 .Height = 480 End With End Sub Then in the VBA module I use: Sub UFtst() UserForm1.Show(Modal) MsgBox "Check Size" Unload UserForm1 End Sub It brings the form up in the larger dimension, which indicates that you can set it to fit your full screen size. "Takashi Yamauchi" wrote: Could anyone give me a suggestion? As I open a UserForm, I want to maximize the size of the form (making it as large as my monitor). In the VB6 Form property, there is a property called "WindowState" and I can select "Maximized." But, I can't find a similar property in Excel VBA. How can I automatically maximize a UserForm in Excel VBA? Thank you Takashi Yamauchi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform to size to display | Excel Programming | |||
UserForm Size On Different Computers | Excel Programming | |||
Print UserForm A4 size | Excel Programming | |||
Print UserForm A4 size | Excel Programming | |||
Userform Size | Excel Programming |