• 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
    
  • 相关阅读:
    怎么知道银行卡号对应的银行
    集合排序、map、枚举
    669. Trim a Binary Search Tree修剪二叉搜索树
    17. Merge Two Binary Trees 融合二叉树
    226. Invert Binary Tree 翻转二叉树
    530.Minimum Absolute Difference in BST 二叉搜索树中的最小差的绝对值
    191. Number of 1 Bits 二进制中1的个数
    Hamming Distance二进制距离
    136. Single Number唯一的数字
    276. Paint Fence篱笆涂色
  • 原文地址:https://www.cnblogs.com/LCX/p/1818628.html
Copyright © 2020-2023  润新知