-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.vb
38 lines (32 loc) · 1.31 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraEditors
Imports DevExpress.XtraTab.Registrator
Imports DevExpress.XtraTab.Drawing
Imports DevExpress.XtraTab
Imports DevExpress.Utils
Namespace WindowsApplication1
Public Partial Class Form1
Inherits XtraForm
Private _CheckedPages As Dictionary(Of XtraTabPage, Boolean) = New Dictionary(Of XtraTabPage, Boolean)()
Public Sub New()
InitializeComponent()
Call PaintStyleCollection.DefaultPaintStyles.Add(New MyRegistrator())
xtraTabControl1.PaintStyleName = "MyStyle"
xtraTabControl1.Tag = _CheckedPages
End Sub
Private Sub xtraTabControl1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim hi As ViewInfo.XtraTabHitInfo = xtraTabControl1.CalcHitInfo(e.Location)
If hi.Page Is Nothing Then Return
Dim inCheck As Boolean = CType(hi.Page.Tag, Rectangle).Contains(e.Location)
If inCheck Then
Dim value As Boolean = False
_CheckedPages.TryGetValue(hi.Page, value)
_CheckedPages(hi.Page) = Not value
End If
xtraTabControl1.Refresh()
End Sub
End Class
End Namespace