-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyPainter.vb
More file actions
31 lines (25 loc) · 1.11 KB
/
MyPainter.vb
File metadata and controls
31 lines (25 loc) · 1.11 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
Imports System.ComponentModel
Imports DevExpress.XtraEditors.Drawing
Imports DevExpress.XtraEditors.ViewInfo
Namespace WindowsApplication1
<System.ComponentModel.DesignerCategory("")>
Public Class MyPainter
Inherits ButtonEditPainter
Public Sub New()
End Sub
Protected Overrides Sub DrawContent(ByVal info As ControlGraphicsInfoArgs)
MyBase.DrawContent(info)
End Sub
Protected Overrides Sub DrawText(ByVal info As ControlGraphicsInfoArgs)
Call RichTextEditPainter.DrawRTF(GetViewInfo(info), info.Cache)
End Sub
Private Function GetViewInfo(ByVal info As ControlGraphicsInfoArgs) As RichTextEditViewInfo
Dim ri As RepositoryItemMyButtonEdit = TryCast(TryCast(info.ViewInfo, ButtonEditViewInfo).Item, RepositoryItemMyButtonEdit)
Dim vi As RichTextEditViewInfo = New RichTextEditViewInfo(ri.RichEdit)
vi.Bounds = info.ViewInfo.ContentRect
vi.EditValue = info.ViewInfo.DisplayText
vi.CalcViewInfo(info.Graphics)
Return vi
End Function
End Class
End Namespace