Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle event in splitter area of splitcontainer control

Is there any trivial way to handle click event on the splitter area of the WinFroms splitcontainer control? (symbolized by blue in my picture) E.g. I'd like to collapse panel1 by double clicking this area.

Or another possibility to put some nice button in this area and by clicking it I can collapse panels.

I don't wanna great hack to make a soulution, it would be nice to have a trivial one.

Thx

(.net 4/c#/VS2010)

enter image description here

like image 576
Tom Avatar asked Dec 16 '25 20:12

Tom


1 Answers

You should be able to use the SplitContainer.DoubleClick event for this purpose..

  splitContainer1.DoubleClick += splitContainer1_DoubleClick;

and

    private void splitContainer1_DoubleClick(object sender, EventArgs e)
    {
        splitContainer1.Panel1Collapsed = true;
    }

If you want the location of the click, use MouseDoubleClick event which comes with MouseEventArgs for the event handler.

like image 129
Bala R Avatar answered Dec 19 '25 10:12

Bala R



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!