-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathForm1.vb
45 lines (37 loc) · 1.72 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
39
40
41
42
43
44
45
Imports DevExpress.LookAndFeel
Imports DevExpress.XtraGrid.Views.Grid
Imports System
Imports System.Drawing
Namespace CellBorder
Public Partial Class Form1
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim tmp_XViewsPrinting = New DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1)
End Sub
Private Sub gridView1_CustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs)
Dim view As GridView = TryCast(sender, GridView)
If e.Column Is view.FocusedColumn AndAlso e.RowHandle = view.FocusedRowHandle Then
e.DefaultDraw()
DrawCellBorder(e)
e.Handled = True
End If
End Sub
End Class
Public Module CellDrawHelper
Public Sub DrawCellBorder(ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs)
Dim penWidth As Integer = 3
Dim frameBounds As Rectangle = e.Bounds
Dim skinName As String = UserLookAndFeel.Default.SkinName
If Not Equals(skinName, "WXI") AndAlso Not Equals(skinName, "WXI Compact") Then
penWidth = 2
frameBounds = New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width + 1, e.Bounds.Height + 1)
End If
penWidth = penWidth * CInt(Math.Ceiling(e.Cache.ScaleDPI.ScaleFactorHorz - 0.5))
Dim _pen As Pen = e.Cache.GetPen(DXSkinColors.ForeColors.ControlText, penWidth)
e.Cache.DrawRectangle(_pen, frameBounds)
End Sub
End Module
End Namespace