Arrows for UserForm resizing

  • Thread starter Thread starter Christian
  • Start date Start date
C

Christian

Hi,

I have created a userform.

Some normal windows applications offer the possiblilty to resize them
when the cursor gets to the e. g. right bottom edge; it turns then
into a diagonal arrow which allows me when clicking to resize the
window.

Is it possible to offer this possibility to my UserForm, too? Is there
perhaps a simple property I just have to set to "true" to enable this
(I couldn't find something like this so far)?

Thanx in advance for any clue,

- Christian
 
Thanks for the advice, but this program is almost bigger than the
program with the UserForm I want to be able to resize.
Isn't there any simpler possibility just like setting a property of
the UserForm to "True" in order to resize it with just a few lines of
code?

Thanks,

- Christian
 
I guess not. In Excel there are only two styles available, so you must
import the GetWindowLong, SetWindowLong and SendMessage functions to set
additional form properties.
 
You do need all that code, only the parts for resizing, probably not more
than a few lines and a couple of declares. You can delete the rest
If you want to achieve effect not exposed by Excel/VBA, you have to do a
little extra work

You will still handle the movement/placement of controls on the resized
userform yourself, if that is a concern.

NickHK
 
Hi Andy,

thank you very much for your help. I used the example in the first
link and it works fine in UserForms without Scrollbars.

The problem in UserForms with a (in this case vertical) scrollbar is,
that the resize-icon is placed left next to the scrollbar and is away
when the window is made smaller than its original width.
Is there a possibility to avoid this?

Greetings,

- Christian
 
You could adjust the calculation to position the resize icon. You would need
to add code to the scroll event. But this would then cover any controls that
are in the bottom right corner when you scroll the userform.

If you want scroll bars AND resizing you should use the API code. It maybe
'heavy' code but it has already been written for you so you only need to
incorporate it in your userform.

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top