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

Autohidetab click event?

2 Answers 82 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Brahim
Top achievements
Rank 1
Brahim asked on 18 Dec 2010, 03:27 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Julian Benkov
Telerik team
answered on 22 Dec 2010, 05:13 PM
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.
0
Brahim
Top achievements
Rank 1
answered on 23 Dec 2010, 12:36 AM
Thank you that works perfectly
Tags
Dock
Asked by
Brahim
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Brahim
Top achievements
Rank 1
Share this question
or