简体   繁体   中英

VBA UserForm Dynamic Resize Event with Multipages

Good Morning!

I started off by reading this :

http://www.andypope.info/vba/resizeform.htm

And while this was very informative, I was wondering if someone one would be able to point me in the right direction to help being able to solve my inquiry. I want to dynamically set height & width values of a userform depending on what multipage selected (presumably by click event). Would it be something like this?

 Sub pageX_click

 height.value = 23
 width.value = 50

 End Sub

I assume it might be more complicated than that, but if someone would be willing to point me in the right direction I can tinker till i find the correct solution.

Other question- due to the differing sizes, would I need to statically set which pages is opened each time? That way i dont get random size issues/errors?

Here is the solution- it was literally as simple as I thought

 Private Sub MultiPage1_Change()

 If MultiPage1.Value = 0 Then
     ToolBoxForm.Height = 560.25
     ToolBoxForm.Width = 652.5
 End If

 'lather, rinse, repeat for each page

 End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM