Link to home
Start Free TrialLog in
Avatar of isda-don
isda-donFlag for United States of America

asked on

Hide part of form on load

Hi Experts,
I'm sure one of you can tell me a better way to accomplish what I need, but here is what I am trying to do.  Attached is a screen shot of the form I am currently working with.  What I'm trying to do is hide the bottom half of the form.  As you can see from the screen shot, I have my "Bank Information" and "Name On Check" fields inside a panel.  I only want those fields to show if the user clicks on the "Create New Profile" button.  I can accomplish this by hiding the panel when the form loads, but I don't want a big blank empty space for the bottom half of my window.  I can't find anything on how to hide part of a form, so I'm thinking there is a better way.
Thanks,
Dan
Doc3.doc
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

One way is just to grab the bottom of the form and drag it up so the bottom half isn't visible.  When the button is pressed you make the form bigger:

    this.Size = new Size(this.Size.Width, this.Seize.Height + 500); // <-- You need to experiment with what value works best for your form

Of course, you need to use some kind of variable to track whether or not the form is currently "expanded" so you don't try to expand it more.  To collapse the form just do the opposite and subtract the right amount...
ASKER CERTIFIED SOLUTION
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial