-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomRadioGroupPainter.vb
33 lines (29 loc) · 1.27 KB
/
CustomRadioGroupPainter.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
Imports System.Drawing
Imports DevExpress.XtraEditors.ViewInfo
Imports DevExpress.XtraEditors.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms
Imports WindowsApplication3
Namespace DXSample
Public Class CustomRadioGroupPainter
Inherits RadioGroupPainter
Public Sub New()
MyBase.New()
End Sub
Protected Overrides Sub DrawRadioGroupItems(ByVal info As ControlGraphicsInfoArgs)
Dim vi As RadioGroupViewInfo = TryCast(info.ViewInfo, RadioGroupViewInfo)
For Each itemInfo As RadioGroupItemViewInfo In vi.ItemsInfo
itemInfo.Cache = info.Cache
Try
Dim e As CustomDrawEventArgs = New CustomDrawEventArgs(info.Cache, itemInfo, vi.RadioPainter, False)
Dim item As RepositoryItemCustomRadioGroup = TryCast(vi.Item, RepositoryItemCustomRadioGroup)
item.RaiseCustomDrawItem(e)
If Not e.Handled Then vi.RadioPainter.DrawObject(itemInfo)
If itemInfo.Focused Then ControlPaint.DrawFocusRectangle(info.Graphics, vi.GetFocusRect(itemInfo))
Finally
itemInfo.Cache = Nothing
End Try
Next
End Sub
End Class
End Namespace