Deploy click-here-to-expand container

I don’t have a better way to explain this, but I want to implement a container that only appears after the user clicks Advanced or the plus sign somewhere in the dialog box. I have a login form and you want to add some “advanced” settings. But they usually should be out of sight.

Of course, the dialog should resize well to hold rich content.

How should I go to realize such a thing. I tried some google searches but can't find the search terms I need. By default, this is not like Windows.

+6
source share
1 answer

as suggested by John Willems, I myself created my own functionality. I added Panel to the form, which I just set visible or invisible.

In the form constructor (to hide it on the first view):

  public FrmLogin() { InitializeComponent(); pnlAdvanced.Visible = false; Height -= pnlAdvanced.Height; } 

Then I added LinkLabel with this Clicked handler:

  private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (pnlAdvanced.Visible == false) { Height += pnlAdvanced.Height; pnlAdvanced.Visible = true; } else { Height -= pnlAdvanced.Height; pnlAdvanced.Visible = false; } } 

It works fine and does not require additional code.

+3
source

All Articles