Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

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.


0
Gabriel_Brienza
Asked:
Gabriel_Brienza
  • 2
1 Solution
 
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
 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now