Problem resizing in a form

I have form with 3 frames

frameTop (includes a listView1)
frameMiddle(includes a customControl1)
frameBottom(includes 5 buttons)

Now
frameTop.visible can be set true or false

if frameTop.visible
all three frames should show.

if frameTop.visible=false
framMiddle should resize and be as big as frameTop and Middle put together.
FrameButton should adjust accordingly below frameMiddle.

Can somebody help me code this in the formResize_Event?

thanks a lot.


Gabriel_BrienzaAsked:
Who is Participating?
 
aikimarkCommented:
you have two choices:
1. place them in bottom-up fashion.  Easiest if your framebottom is flush with the bottom of the form.
Example:
frameBottom.top = me.scaleheight - frameBottom.height
if frameTop.visible then
  frameMiddle.height = frameBottom.top - frameTop.height
  frameMiddle.top = frameTop.height
else
  frameMiddle.top = 0
  frameMiddle.height = frameBottom.top
end if
'no need to change frameTop position or size

2.  Place them in top-down fashion
Example
'no need to cahnge frameTop position or size
if frameTop.visible then
  frameMiddle.height = defaultHeight   'value you keep in numeric variable
  frameMiddle.top = frameTop.height
else
  frameMiddle.top = 0
  frameMiddle.height = frameTop.height + defaultHeight
end if
frameBottom.top = frameMiddle.top + frameMiddle.height

0
 
pradapkumarCommented:
If you Make frame visible or invisible how it fires the FormResize event?
How you make form Visible and Invisible?
Using COmmand button or any other control?
Post your code here and i try to solve your problem.
0
 
Gabriel_BrienzaAuthor Commented:

Thanks for your replies.
Just for clarity.There is menuitem where you check /uncheck and that sets the visibility to either true or false and calls the form_Resize Event.

What about the controls that are within the frames

frameTop (includes a listView1)
frameMiddle(includes a customControl1)
frameBottom(includes 5 buttons)

should adjust them to  be the height and width of the frame?

Thanks
0
 
Gabriel_BrienzaAuthor Commented:
Thanks it solved my problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.