How to bottom-align a control on a UserForm?

B

baobob

I've dropped a button on a UserForm. The UserForm is user-resizeable
(thanks to Bullen's FunForm.)

What height property or other vertical quantity do I access in order
to programmatically position the button flush against the bottom of
the form? I want to re-bottom-justify the button in UserForm_Resize
(hope that's the correct event).

I've tried:

1) UserForm.Height seems to be useless, because it seems to include
the form's caption area. So if I say:

Button1.Top = UserForm.Height - Button1.Height

then the button's too low by approx. UserForm's caption.

2) Application.UseableHeight sounds promising, but on one Win 2K PC it
seems to return Excel's own (or possibly the open workbook's) useable
height, which is, like 100 pixels (points?) larger than
UserForm.Height.

(BUT, on another Win 2K PC with a different screen res., the button
ends up aligning PERFECTLY, no matter how the user resizes the form.
Don't quite understand THAT coincidence.)

3) UserForm has no UseableHeight property that I can see.

I suppose another way of asking this is: Is there a way to determine
the height of an application's caption area?

Thanks much.

***
 
C

ctm

I think they are only able to be set from the TOP of the form not the
bottom.(could be wrong though)

Is the form height programmed ? If so you could probably use that code to
set the button position.
If not i think you would have to adopt the button TOP procedure.

Ctm
 
B

baobob

ctm:

Thanks very much for reply.

But I think I've found the answer, namely: PIADAU (Programmer Is A
Doofus As Usual).

I *completely* didn't notice InsideHeight (and companion InsideWidth)
in UserForm's list of properties.

Tried it on the problematic PC, and it works.

I feel this property is so important, I'll post another thread.

Thanks again.

***
 

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