splitter click event

4 posts, 1 answers
  1. PR
    PR avatar
    5 posts
    Member since:
    Sep 2006

    Posted 17 Dec 2013 Link to this post

    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
  2. Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 20 Dec 2013 Link to this post

    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 >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. PR
    PR avatar
    5 posts
    Member since:
    Sep 2006

    Posted 20 Dec 2013 Link to this post

    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?
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 21 Dec 2013 Link to this post

    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 >>
Back to Top