Maximize and Minimize Areas of a form

E

Eka1618

Hello,

I am interested in creating a form that includes areas in the form that act
similar to the expand and contrast buttons (+/-). The idea is to show or hide
subforms and resize the parent form each time these buttons are clicked.

I have been able to hide subforms, but I am having trouble adjusting the
height & top properties of each subform. There are like 20 subforms in this
parent form, so it is becoming a lot of code. I guess i'm just wondering if
anyone has a simpler idea.

Let me know of any suggestions, Thank You!

~Erica~
 
B

BruceM

It is hard to know if a suggestion is simpler than what you have tried
without knowing what you have tried, but you could try MoveSize. Help has
more information. Note that MoveSize uses a unit known as a twip as the
measurement unit. There are 1440 twips per inch, so you could use 2.5 *
1440 if you want to use 2 1/2 inches as a measurement. It's easier to
adjust if you do it that way, IMO.
 
D

Dale Fye

Hve you considered putting the subforms on individual tabs of a tab control?
Then they are only visible when the tab is selected.

Another way would be to keep the names of you expand/contract buttons, and
their associated subform in a table, sorted from top to bottom on the form.
Then, each time some clicked on one of the expand/contract buttons, you could
loop through each of the subsequent records and change the Top property based
on the status of each expand/contract button and the expanded/contracted
height of the subform.

Put all this code in a subroutine that you can pass in the name of the
control just clicked.

HTH
Dale
 
E

Eka1618

Thanks for these suggestions Dale.

I have been using the tab control on some of my forms already. I guess i
just wanted to try changing the height properties when the btn was clicked.
The problem is that I use a string variable when i am referencing a sub form.

for instance, I was thinking about something along the lines of this:

Dim frmTest as string
dim testVisible as boolean

....
....
....


if me.subfrmImpact.visible = true then
frmTest = "subFrmImpact"
testVisible = true

....
....
....


btnTest_click()

if TestVisible = true then
me.frmTest.visible = false
testVisible = false
else
me.frmTest.visible = true
end if

end sub()



It will not let me use the string in the 'me.' statements though. I just
wanted to beable to use a pointer of some sort to the subform that is visible
after a user select an option from a combo box.

I have some new ideas based from a couple things you said, so I am going to
try that out for now.

~Erica~
 

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