-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyPainter.cs
39 lines (32 loc) · 1.09 KB
/
MyPainter.cs
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
using System;
using System.ComponentModel;
using DevExpress.XtraEditors.Drawing;
using DevExpress.XtraEditors.ViewInfo;
using DevExpress.XtraEditors.Repository;
namespace WindowsApplication1
{
[System.ComponentModel.DesignerCategory("")]
public class MyPainter : ButtonEditPainter
{
public MyPainter()
{
}
protected override void DrawContent(ControlGraphicsInfoArgs info)
{
base.DrawContent(info);
}
protected override void DrawText(ControlGraphicsInfoArgs info)
{
RichTextEditPainter.DrawRTF(GetViewInfo(info), info.Cache);
}
private RichTextEditViewInfo GetViewInfo(ControlGraphicsInfoArgs info)
{
RepositoryItemMyButtonEdit ri = (info.ViewInfo as ButtonEditViewInfo).Item as RepositoryItemMyButtonEdit;
RichTextEditViewInfo vi = new RichTextEditViewInfo(ri.RichEdit);
vi.Bounds = info.ViewInfo.ContentRect;
vi.EditValue = info.ViewInfo.DisplayText;
vi.CalcViewInfo(info.Graphics);
return vi;
}
}
}