Vipin Kumar
asked on
Display the VBA Userform in Screen Center
Hi,
I want to display my VBA Userform in the screen center even if I change the height and width of the Userform.
For example when I initialize my Userform I have set the value of the property Startupposition to 2-CenterScreen and the height and width of form is set to 50 and 250 respectively. Depending on the value of a combobox in the form the Height and Width of the form changes, but as my form has already initialized in the screen center with height and width of 50 and 250 respectively, if either of height or width increases the form increases it height or width but doesnot center.
I want to achieve a way to center the form everytime it's height or width is changed.
Kindly let me know if anything else is required.
Thanks in advance.
I want to display my VBA Userform in the screen center even if I change the height and width of the Userform.
For example when I initialize my Userform I have set the value of the property Startupposition to 2-CenterScreen and the height and width of form is set to 50 and 250 respectively. Depending on the value of a combobox in the form the Height and Width of the form changes, but as my form has already initialized in the screen center with height and width of 50 and 250 respectively, if either of height or width increases the form increases it height or width but doesnot center.
I want to achieve a way to center the form everytime it's height or width is changed.
Kindly let me know if anything else is required.
Thanks in advance.
Have you set the StartUPPosition Property to 1?
ASKER
@Roy_Cox,
I have set the Startupposition to 1 but when the height and width of form changes then form is not centered.
I have set the Startupposition to 1 but when the height and width of form changes then form is not centered.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Pleased to help