Resize User Form

The Resize User Form demonstration project shows how to resize a user form either by dragging its borders, by clicking the maximize icon of the title bar or by double-clicking the title bar or the resize icon at lower right hand corner. Clicking this icon again will reduce the user form to its minimum size and center it on the screen.

The code is based on the work of Stephen Bullen but was extended by allowing a minimum size to be specified. This is the size of the user form which must not be fallen below.

The project demonstrates, too, how to add maximize and minimize buttons to a user forms title bar. Since minimizing an Excel user form does not make any sense in most cases, the minimize button is disabled by default. The code's comments show how to enable it.

Giving MS Excel user forms the capability to be resized increases useability dramatically. The combination of options presented in this demonstration project gives a user all flexibility required.

A user can simply double-click the title bar in order to maximize the user form and use another double-click for bringing it to its previous size and position.

Double-clicking the resize icon at lower right hand side of the user form will nearly maximize the user form, giving the option to see the status bar, still. This is benefitial in case a lengthy operation is planned and progress indication is given by counters within the status bar. Another double-click will decrease the user form to its minimum size.

And finally a user can manually drag a user form to the size desired. By combining the methods a user can handle user forms intuitive, flexible and fast.

Credits: Stephen Bullen, Office Automation Ltd.

Download Demo Project:
Download
ResizeDemo.zip