Closing SplitContainer's panel with a standard button

Hello

I have a SplitContainer with two panels.  I want to make one of them to be closed with a standard Windows closing button (X - Button).

Any comments will be helpful.

Thanks

Eli
afikimAsked:
Who is Participating?
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
You can do:
Me.SplitContainer1.Panel1Collapsed = False

Open in new window

0
 
afikimAuthor Commented:
Hi JPaolino

I tried your code.  It doesn't do what I need.
I need the panel to be with "X" button for closing it.  Is there any standard closing button to do that?

Thanks

Eli

0
 
Jorge PaulinoIT Pro/DeveloperCommented:
>> I need the panel to be with "X" button for closing it.  Is there any standard closing button to do that?
You can create your "X" button and use that code.
Maybe I'm not understand it right!
0
 
gisTimmyConnect With a Mentor Commented:
I think what jpaulino means is that you would have to put a Button on your form and put this in the button's click event:

SplitContainer1.Panel1Collapsed = True

This would close Panel1 of the Split Container (The left panel for a vertical splitter, or the top panel for a horizontal splitter).

If you want to re-open the panel, you use "SplitContainer1.Panel1Collapsed = False"

Best would be to code the button to toggle the collapse:

  SplitContainer1.Panel1Collapsed = Not SplitContainer1.Panel1Collapsed

This would collapse the panel if is isn't collapsed, and open it if it is collapsed.
0
 
afikimAuthor Commented:
Hi JPaulino and gisTimmy

First I thought that there might be a standard "close button to the panel but now I understand that there isn't such a button.

As for the code JPaulino wrote,  I was a little confused.  It should have beed "Me.SplitContainer1.Panel1Collapsed = True" .

Thanks you both and enjoy your day

Eli
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.