PC Review


Reply
Thread Tools Rate Thread

Arrows for UserForm resizing

 
 
Christian
Guest
Posts: n/a
 
      9th May 2007
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

 
Reply With Quote
 
 
 
 
moon
Guest
Posts: n/a
 
      9th May 2007
Google for 'FormFun'. This example offers an icon, min/max buttons and also
a sizeable form.

http://www.oaltd.co.uk/Excel/Default.htm





"Christian" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Christian
Guest
Posts: n/a
 
      9th May 2007
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

 
Reply With Quote
 
moon
Guest
Posts: n/a
 
      9th May 2007

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.


"Christian" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      9th May 2007
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

"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      9th May 2007
Hi,

There is no property so you will need more than a couple of lines of code.
For a non api solution
http://www.andypope.info/vba/resizeform.htm

For a solution that also handles control resizing
http://www.andypope.info/vba/Anchor.htm

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
Christian
Guest
Posts: n/a
 
      9th May 2007
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


 
Reply With Quote
 
Andy Pope
Guest
Posts: n/a
 
      10th May 2007
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

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing Userform =?Utf-8?B?RXhjZWxNb25rZXk=?= Microsoft Excel Programming 1 21st Apr 2007 12:33 AM
Resizing and Printing a UserForm kudruu@gmail.com Microsoft Excel Programming 3 19th Apr 2007 06:14 PM
Re: auto-resizing UserForm window NickHK Microsoft Excel Programming 2 11th Jan 2007 08:02 AM
Re: auto-resizing UserForm window John Bundy Microsoft Excel Programming 0 10th Jan 2007 05:15 PM
Userform resizing lmarks Microsoft Excel Programming 5 4th Aug 2004 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 AM.