Autohidetab click event?

3 posts, 1 answers
  1. Brahim
    Brahim avatar
    4 posts
    Member since:
    Feb 2009

    Posted 18 Dec 2010 Link to this post

    Hi I have setup a raddock and have 7 toolwindows setup in autohide along the top. What I would like to do is be able to click on the tab and have the toolwindow dock into it's dock position, I can do it via a button event with the Dockstate.Docked command but would like to do it on the tab instead. I am using VB.NET Any help would be greatly appreciated thanks.
  2. Answer
    Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 22 Dec 2010 Link to this post

    Hi Brahim,

    You can use the DockStateChanged event  to implement this functionality. Here is a solution:

    Private Sub radDock1_DockStateChanged(sender As Object, e As DockWindowEventArgs)
        If e.DockWindow.DockState = DockState.AutoHide Then
            Dim tabStripItem As TabStripItem = Me.radDock1.GetAutoHideTab(e.DockWindow)
            If tabStripItem IsNot Nothing Then
                tabStripItem.Click += New EventHandler(AddressOf tabStripItem_Click)
            End If
        End If
    End Sub
     
    Private Sub tabStripItem_Click(sender As Object, e As EventArgs)
        Dim tabStripItem As TabStripItem = TryCast(sender, TabStripItem)
        DirectCast(tabStripItem.TabPanel, DockWindow).DockState = DockState.Docked
    End Sub

    I hope you find this information helpful.

    Best wishes,
    Julian Benkov
    the Telerik team
    Check out the Q1 2011 Roadmap for Telerik Controls for Windows Forms.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Brahim
    Brahim avatar
    4 posts
    Member since:
    Feb 2009

    Posted 22 Dec 2010 Link to this post

    Thank you that works perfectly
Back to Top