Expanding a form

A

Adrian

Hi All,

I am wanting to create a userform that can operate at two
levels. Simple and Advanced.

My intention is to add a commandbutton that when clicked
expands the centre section of the userform to reveal some
more advanced features.

I cannot figure how to achieve this. Has anyone any ideas
or pointers as to how I should proceed.

As always, I would be very grateful for any assistance.

Regards

Adrian
 
T

Tom Winter

You just need to play with the height of the form, and probably
enabling/disabling controls. Layout your form in the VB IDE as though it was
in "advanced mode". Then resize the form so that the "advanced" stuff is
hidden. Include and "expand" button in the "simple" part of the form. Have
that button resize the form. You might want to check if the user can tab
into the "hidden" controls while you are in "simple" mode. Not sure if they
can do that even when they are not visible.

Here's a routine I use. Very simple:

Private Sub cmdExpand_Click()

Me.Height = 3600

cmdExpand.Enabled = False

End Sub
 
A

adrian

Hi Thom,

many thanks for that, its given me the right direction.

I have applied your theory and it works a treat. Also
resized the frames too which worked well. As the frame
reduces it hides any extra features.
The usual line up of button at the base of the frame (OK,
Cancel etc) can be repositioned by altering the "Top"
value.

great stuff. Very gratfull to you.

regards
Adrian
 

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

Top