This is a migrated thread and some comments may be shown as answers.

splitter click event

3 Answers 249 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
PR
Top achievements
Rank 1
PR asked on 17 Dec 2013, 01:29 PM
Hi,
I am trying to trigger the event click on a splitter.
I tried with this code:

AddHandler RadSplitContainer1.Splitters(0).Click, AddressOf SplitterClick

But nothing happens.
Do you have any advice?


I'm using RadControls 2013Q3.
Thanks

3 Answers, 1 is accepted

Sort by
0
Ralitsa
Telerik team
answered on 20 Dec 2013, 10:42 AM
Hi Patrice, 

Thank you for writing us. 

If you need capture the click event of certain splitter you can subscribe to the MouseDown event of the SplitterElementLayout. You can use the following code sample: 
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
       'Subcribe for MouseDown event
       AddHandler Me.RadSplitContainer1.Splitters(0).Layout.MouseDown, AddressOf Layout_MouseDown
 
       ' Or set the NotifyParentOnMouseInput property to true and subscribe for MouseDown event.
       Me.RadSplitContainer1.Splitters(1).Layout.NotifyParentOnMouseInput = True
       AddHandler Me.RadSplitContainer1.Splitters(1).MouseDown, AddressOf Form1_MouseDown
   End Sub
 
   Private Sub Layout_MouseDown(sender As Object, e As MouseEventArgs)
       'Handle event
       Me.RadLabel1.Text = "Layout_MouseDown " & DateTime.UtcNow
   End Sub
 
   Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs)
       'Handle event
       Me.RadLabel2.Text = "Form1_MouseDown " & DateTime.UtcNow
   End Sub

The NotifyParentOnMouseInput property is indicating whether the element should pass the handled mouse event to the first parent element.
 
If you need to capture the click event you can subscribe for the Click event of the RadSplitContainer. This event is fired each time when a splitter is clicked: 
Private Sub RadSplitContainer1_Click(sender As Object, e As EventArgs) Handles RadSplitContainer1.Click
    Me.RadLabel3.Text = "RadSplitContainer1_Click " & DateTime.UtcNow
End Sub

If this is not what you are looking for, please send me detailed explanation of what you want to achieve.

Do not hesitate to write back with further questions.

Regards,
Ralitsa
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
PR
Top achievements
Rank 1
answered on 20 Dec 2013, 01:43 PM
This is perfect thank you!

Sorry, but I have one last question.

In fact, I just want to click on the splitter to reduce / enlarge my first panel.
But if the panel is collapsed I can not see the splitter.
Is there a setting to see the splitter when the first panel is collapsed?
0
Accepted
Stefan
Telerik team
answered on 21 Dec 2013, 07:52 AM
Hi Patrice, 

The splitters will be hidden when they are not needed, hence they cannot remain visible in this case. To achieve your scenario, perhaps you can consider using RadDock with couple ToolWindows which support auto-hide capability. You can also hide the ToolWindow caption to make it look like a panel and you can cancel the drag operations if not needed. 

I hope that you find this information useful.

Regards,
Stefan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
SplitContainer
Asked by
PR
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
PR
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or