-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomRadioGroupPainter.cs
More file actions
46 lines (42 loc) · 1.49 KB
/
CustomRadioGroupPainter.cs
File metadata and controls
46 lines (42 loc) · 1.49 KB
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
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraEditors.Registrator;
using DevExpress.XtraEditors.Repository;
using System.Drawing;
using System.Reflection;
using DevExpress.XtraEditors.ViewInfo;
using DevExpress.XtraEditors.Drawing;
using DevExpress.XtraEditors;
using System.ComponentModel;
using System.Windows.Forms;
using WindowsApplication3;
namespace DXSample
{
public class CustomRadioGroupPainter : RadioGroupPainter
{
public CustomRadioGroupPainter() : base() { }
protected override void DrawRadioGroupItems(ControlGraphicsInfoArgs info)
{
RadioGroupViewInfo vi = info.ViewInfo as RadioGroupViewInfo;
foreach (RadioGroupItemViewInfo itemInfo in vi.ItemsInfo)
{
itemInfo.Cache = info.Cache;
try
{
CustomDrawEventArgs e = new CustomDrawEventArgs(info.Cache, itemInfo, vi.RadioPainter, false);
RepositoryItemCustomRadioGroup item = vi.Item as RepositoryItemCustomRadioGroup;
item.RaiseCustomDrawItem(e);
if (!e.Handled)
vi.RadioPainter.DrawObject(itemInfo);
if (itemInfo.Focused)
ControlPaint.DrawFocusRectangle(info.Graphics, vi.GetFocusRect(itemInfo));
}
finally
{
itemInfo.Cache = null;
}
}
}
}
}