zoukankan      html  css  js  c++  java
  • TabController控件测试

    下载及安装参照:http://www.cnblogs.com/dragon/archive/2005/03/24/124771.html

    测试:拖动标签、双击关闭标签

     '关闭按钮触发
        Private Sub TabController_ClosePressed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabController.ClosePressed
            MsgBox("ClosePressed--" & TabController.SelectedTab.Name.ToString)
        End Sub
    
    
    
        'Tab Drag and Drop
        Dim TabDragging As Boolean
    
        Private Sub TabController_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabController.MouseLeave
            If TabDragging = True Then
                'Debug.Print("stop drag")
                TabDragging = False
                Me.Cursor = Cursors.Default
            End If
        End Sub
    
        Private Sub TabController_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabController.MouseMove
            If e.Button = Windows.Forms.MouseButtons.Left Then
                'Debug.Print("dragging")
                TabDragging = True
                Me.Cursor = Cursors.SizeWE
            ElseIf e.Button = Windows.Forms.MouseButtons.None Then
                If TabDragging = True Then
                    'Debug.Print("stop drag")
                    TabDragging = False
                    Me.Cursor = Cursors.Default
                End If
            End If
        End Sub
    
        Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabController.MouseUp
            If e.Button = Windows.Forms.MouseButtons.Left Then
                If TabDragging = True Then
                    Dim sourceTab As Crownwood.Magic.Controls.TabPage = TabController.SelectedTab
                    Dim targetTab As Crownwood.Magic.Controls.TabPage = TabController.TabPageFromPoint(e.Location)
                    Dim targetIndex As Integer = -1
    
                    For i = 0 To TabController.TabPages.Count - 1
                        If TabController.TabPages(i) Is targetTab Then
                            targetIndex = i
                        End If
                    Next
    
                    If sourceTab IsNot targetTab And targetIndex > -1 Then
                        TabController.TabPages.Remove(sourceTab)
                        TabController.TabPages.Insert(targetIndex, sourceTab)
                        TabController.SelectedTab = sourceTab
                    End If
                End If
            ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then
                If TabDragging = False Then
                    '   Tabs.Action.CloseActiveTab()
                End If
            End If
        End Sub
    
    
        '双击标签触发
        Public Sub TabController_DoubleClickTab(ByVal sender As Crownwood.Magic.Controls.TabControl, ByVal page As Crownwood.Magic.Controls.TabPage) Handles TabController.DoubleClickTab
            MsgBox("DoubleClickTab--" & page.Name.ToString)
        End Sub
    
  • 相关阅读:
    I帧/P帧/B帧---术语解释
    利用forwardInvocation实现消息重定向
    doubango地址配置
    ARC使用小结
    NSException异常处理
    Runtime of Objective-C
    perl脚本框架整理
    模块——Getopt::Long接收客户命令行参数和Smart::Comments输出获得的命令行参数内容
    Linux学习进阶示意图
    Linux——入门命令
  • 原文地址:https://www.cnblogs.com/LCX/p/1818628.html
Copyright © 2011-2022 走看看