-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomFontEdit.vb
68 lines (62 loc) · 1.94 KB
/
CustomFontEdit.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports DevExpress.XtraEditors
Imports System.ComponentModel
Imports DevExpress.XtraEditors.Popup
Imports System.Drawing
Imports System.Windows.Forms
Namespace CustomFontEditControl
Friend Class CustomFontEdit
Inherits FontEdit
' static constructor
Shared Sub New()
RepositoryItemCustomFontEdit.RegisterCustomFontEdit()
End Sub
' public constructor
Public Sub New()
End Sub
Private protPopupCommonForm As FontDialogCommonForm
Private ReadOnly Property PopupCommonForm() As FontDialogCommonForm
Get
If protPopupCommonForm Is Nothing Then
protPopupCommonForm = New FontDialogCommonForm(Me.Properties)
protPopupCommonForm.FormBorderStyle = FormBorderStyle.FixedDialog
protPopupCommonForm.Text = ""
protPopupCommonForm.ControlBox = False
End If
Return protPopupCommonForm
End Get
End Property
' ovverride property
Public Overrides ReadOnly Property EditorTypeName() As String
Get
Return RepositoryItemCustomFontEdit.CustomFontEditorName
End Get
End Property
' property as corresponded repositoryitem
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public Shadows ReadOnly Property Properties() As RepositoryItemCustomFontEdit
Get
Return TryCast(MyBase.Properties, RepositoryItemCustomFontEdit)
End Get
End Property
Protected Overrides Function CreatePopupForm() As PopupBaseForm
Dim bounds As Rectangle = CalcPopupFormBounds(PopupCommonForm.Size)
PopupCommonForm.Location = bounds.Location
PopupCommonForm.currentEditor = Me
PopupCommonForm.ShowDialog()
Return Nothing
End Function
<Browsable(False), EditorBrowsable(EditorBrowsableState.Never)> _
Public Overrides Property SelectedIndex() As Integer
Get
Return 0
End Get
Set(ByVal value As Integer)
End Set
End Property
End Class
End Namespace