|
1 | | -Imports Microsoft.VisualBasic |
2 | 1 | Imports System |
3 | | -Imports System.Collections.Generic |
4 | 2 | Imports System.ComponentModel |
5 | | -Imports System.Data |
6 | 3 | Imports System.Drawing |
7 | | -Imports System.Text |
8 | | -Imports System.Windows.Forms |
9 | | -Imports DevExpress.XtraEditors |
10 | | -Imports DevExpress.XtraTab.Registrator |
11 | 4 | Imports DevExpress.XtraTab.Drawing |
12 | 5 | Imports DevExpress.XtraTab |
13 | 6 | Imports DevExpress.Utils |
14 | 7 | Imports DevExpress.XtraTab.ViewInfo |
15 | 8 |
|
16 | 9 | Namespace WindowsApplication1 |
17 | | - Public Class MySkinTabPainter |
18 | | - Inherits SkinTabPainter |
19 | 10 |
|
20 | | - Public Sub New(ByVal tabControl As DevExpress.XtraTab.IXtraTab) |
21 | | - MyBase.New(tabControl) |
| 11 | + Public Class MySkinTabPainter |
| 12 | + Inherits SkinTabPainter |
22 | 13 |
|
23 | | - End Sub |
| 14 | + Public Sub New(ByVal tabControl As IXtraTab) |
| 15 | + MyBase.New(tabControl) |
| 16 | + End Sub |
24 | 17 |
|
25 | | - Protected Overrides Sub DrawHeader(ByVal e As TabDrawArgs) |
26 | | - MyBase.DrawHeader(e) |
27 | | - Dim bounds As Rectangle = e.Bounds |
28 | | - Dim headerText As String = "----------------------- Custom draw header -----------------------" |
29 | | - e.Graphics.DrawString(headerText, New Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.Black, bounds) |
30 | | - bounds.Offset(-2, -2) |
31 | | - e.Graphics.DrawString(headerText, New Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.White, bounds) |
32 | | - For Each rowInfo As BaseTabRowViewInfo In e.ViewInfo.HeaderInfo.Rows |
33 | | - For i As Integer = 0 To rowInfo.Pages.Count - 1 |
34 | | - Dim pageBounds As Rectangle = rowInfo.Pages(i).Bounds |
35 | | - pageBounds.Offset(0, 20) |
36 | | - e.Graphics.DrawString(Environment.NewLine & "Custom draw", AppearanceObject.DefaultFont, Brushes.Black, pageBounds) |
37 | | - pageBounds.Offset(-1, -1) |
38 | | - e.Graphics.DrawString(Environment.NewLine & "Custom draw", AppearanceObject.DefaultFont, Brushes.Yellow, pageBounds) |
39 | | - Next i |
40 | | - Next rowInfo |
41 | | - |
42 | | - End Sub |
43 | | - |
44 | | - End Class |
| 18 | + Protected Overrides Sub DrawHeader(ByVal e As TabDrawArgs) |
| 19 | + MyBase.DrawHeader(e) |
| 20 | + Dim bounds As Rectangle = e.Bounds |
| 21 | + Dim headerText As String = "----------------------- Custom draw header -----------------------" |
| 22 | + e.Graphics.DrawString(headerText, New Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.Black, bounds) |
| 23 | + bounds.Offset(-2, -2) |
| 24 | + e.Graphics.DrawString(headerText, New Font(AppearanceObject.DefaultFont.FontFamily, 14, FontStyle.Bold), Brushes.White, bounds) |
| 25 | + For Each rowInfo As BaseTabRowViewInfo In e.ViewInfo.HeaderInfo.Rows |
| 26 | + For i As Integer = 0 To rowInfo.Pages.Count - 1 |
| 27 | + Dim pageBounds As Rectangle = rowInfo.Pages(i).Bounds |
| 28 | + pageBounds.Offset(0, 20) |
| 29 | + e.Graphics.DrawString(Environment.NewLine & "Custom draw", AppearanceObject.DefaultFont, Brushes.Black, pageBounds) |
| 30 | + pageBounds.Offset(-1, -1) |
| 31 | + e.Graphics.DrawString(Environment.NewLine & "Custom draw", AppearanceObject.DefaultFont, Brushes.Yellow, pageBounds) |
| 32 | + Next |
| 33 | + Next |
| 34 | + End Sub |
| 35 | + End Class |
45 | 36 | End Namespace |
0 commit comments