Problem resizing in a form

Posted on 2006-05-02
Last Modified: 2010-05-01
I have form with 3 frames

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

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.

Question by:Gabriel_Brienza
    LVL 9

    Expert Comment

    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.
    LVL 44

    Accepted Solution

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

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


    Author Comment


    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?


    Author Comment

    Thanks it solved my problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now