Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with a expandable and collapsible form, THX

357 views
Skip to first unread message

John VS

unread,
Aug 17, 2000, 3:00:00 AM8/17/00
to
Hello,
I have a quick question, I want to make a form, where when you click a
button labeled details, it will expand the current form and add room at the
bottom to show you more information, about what you selected.
I know that I can trigger textboxes and comboboxs et. to become visible
when you do certain actions, what I don't know how to do is make the whole
form grow and shrink on a button click. The only way I can make it work
right now is make two different forms, one that has all the basic
information, and another that has all the detailed information. And you
close the simple one and open the advanced one, when you click a button on
the simple form, and go back when you click a button on the advanced form.
I find this method to be clunky.
If anyone knows of a way to make an expandable and collapsible form, that
will expand and contract on a click of a button I would appreciate any help
hints tips, etc that they can provide.
Thanks in advance,
John VS


Turtle

unread,
Aug 17, 2000, 3:00:00 AM8/17/00
to
This was included in an article in the Access-VB Advisor Magazine a few
months ago.

As I recall, the technique comes down to using the form's Height property.
You can set this dynamically.

HTH
- Turtle
John VS wrote in message ...

Marshall Barton

unread,
Aug 17, 2000, 3:00:00 AM8/17/00
to
I didn't see the article, but I believe that should be the
InsideHeight property.

Marsh


Turtle wrote in message <8ni2jh$23g$1...@slb1.atl.mindspring.net>...


>This was included in an article in the Access-VB Advisor Magazine a
few
>months ago.
>
>As I recall, the technique comes down to using the form's Height
property.
>You can set this dynamically.
>
>HTH
> - Turtle
>John VS wrote in message ...
>>Hello,
>> I have a quick question, I want to make a form, where when you
click a
>>button labeled details, it will expand the current form and add room
at the
>>bottom to show you more information, about what you selected.
>> I know that I can trigger textboxes and comboboxs et. to become
visible
>>when you do certain actions, what I don't know how to do is make the
whole
>>form grow and shrink on a button click

[snip]

Marshall Barton

unread,
Aug 18, 2000, 3:00:00 AM8/18/00
to
John, please keep the correspondance in the NewsGroup.

Here's a procedure to change the form's size to expose or hide the
bottom part of the form's detail section:

Const MARGIN As Integer = 0.05 * 1440
Private Sub cmdExpand_Click()
If cmdExpand.Caption = "Collapse" Then
Me.InsideHeight = txtDateCreated.Top - _
MARGIN + FormHeader.Height - _
FormFooter.Visible * FormFooter.Height
cmdExpand.Caption = "Expand"
Else
Me.InsideHeight = txtDateChanged.Top + _
txtDateChanged.Height + _
MARGIN + FormHeader.Height - _
FormFooter.Visible * FormFooter.Height
cmdExpand.Caption = "Collapse"
End If
End Sub

Where txtDateCreated is the name of the top most control to be hidden,
txtDateChanged is the name of the bottom most control to be exposed,
and cmdExpand is the name of the button.

Another approach that is sometimes useful is to put the extra controls
in the form's footer and make the footer visible or not.

Private Sub cmdShow_Click()
If FormFooter.Visible Then
cmdShow.Caption = "Show"
FormFooter.Visible = False
Me.InsideHeight = Me.InsideHeight - FormFooter.Height
Else
cmdShow.Caption = "Hide"
Me.InsideHeight = Me.InsideHeight + FormFooter.Height
FormFooter.Visible = True
End If
End Sub

Or you could go berserk and have two buttons . . .

Marsh


<<<<<Copy of private email<<<<<<<<<<<<
Thanks for the help,

The tip to use InsideHeight, was very helpful, or should be if I can
figure out how to use it. Now I am faced with the problem of figuring
out how to work with InsideHeight. I can't seem to make it do
anything except spit out error messages. And I found the help files
from Microsoft suck, when it comes to trying to explain how you work
with InsideHeight.

If you could help me in anyway with this InsideHeight property and
tying it to a button to change the size of a form. I would appreciate
greatly.

Thanks in advance,
John VS


Marshall Barton wrote in message
<8nibip$r5h$1...@slb1.atl.mindspring.net>...

0 new messages