-
Notifications
You must be signed in to change notification settings - Fork 0
/
ucBtn.ctl
executable file
·164 lines (146 loc) · 4.62 KB
/
ucBtn.ctl
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
VERSION 5.00
Begin VB.UserControl ucBtn
Appearance = 0 'Flat
BackColor = &H00FFFFFF&
ClientHeight = 885
ClientLeft = 0
ClientTop = 0
ClientWidth = 1830
ScaleHeight = 885
ScaleWidth = 1830
Begin VB.Shape shpBorder
BorderColor = &H00808080&
Height = 735
Left = 0
Top = 0
Width = 1695
End
Begin VB.Label lblCap
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Caption"
BeginProperty Font
Name = "΢ÈíÑźÚ"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 300
Left = 240
TabIndex = 0
Top = 120
Width = 795
End
Begin LockPro.PngImage pngMs
Height = 480
Left = 0
Top = 0
Width = 1005
_ExtentX = 1773
_ExtentY = 847
Image = "ucBtn.ctx":0000
Scaler = 1
Opacity = 0
OLEdrop = 1
Props = 4
End
Begin LockPro.PngImage pngBtn
Height = 600
Left = 0
Top = 0
Width = 1485
_ExtentX = 2619
_ExtentY = 1058
Image = "ucBtn.ctx":04C7
Scaler = 1
OLEdrop = 1
Props = 4
End
Begin LockPro.PngImage pngBg
Height = 600
Left = 0
Top = 0
Width = 1485
_ExtentX = 2619
_ExtentY = 1058
Image = "ucBtn.ctx":098E
Scaler = 1
OLEdrop = 1
Props = 5
End
End
Attribute VB_Name = "ucBtn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Event Click()
Event DblClick()
Private Sub lblCap_Click()
pngMs_Click 1
End Sub
Private Sub lblCap_DblClick()
pngMs_DblClick 1
End Sub
Private Sub lblCap_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
pngMs_MouseDown Button, Shift, x, y
End Sub
Private Sub lblCap_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
pngMs_MouseUp Button, Shift, x, y
End Sub
Private Sub pngMs_Click(ByVal Button As Integer)
RaiseEvent Click
End Sub
Private Sub pngMs_DblClick(ByVal Button As Integer)
RaiseEvent DblClick
End Sub
Private Sub pngMs_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
pngMs.FadeInOut 0, 30
pngBtn.FadeInOut 0, 30
End Sub
Private Sub pngMs_MouseEnter()
pngMs.FadeInOut 100, 15
End Sub
Private Sub pngMs_MouseExit()
pngMs.FadeInOut 0
End Sub
Private Sub pngMs_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
pngBtn.FadeInOut 100
End Sub
Private Sub UserControl_Resize()
pngBtn.Move 0, 0, UserControl.ScaleWidth + 20, UserControl.ScaleHeight
pngMs.Move 0, 0, pngBtn.Width, pngBtn.Height
pngBg.Move 0, 0, pngBtn.Width, pngBtn.Height
shpBorder.Move 0, 0, UserControl.ScaleWidth, UserControl.ScaleHeight
lblCap.Move (pngBtn.Width - lblCap.Width) / 2, (pngBtn.Height - lblCap.Height) / 2
End Sub
Public Property Get Caption() As String
Caption = lblCap.Caption
End Property
Public Property Let Caption(ByVal nCap As String)
PropertyChanged "Caption"
lblCap.Caption = nCap
UserControl_Resize
End Property
Public Property Get FontSize() As Single
FontSize = lblCap.FontSize
End Property
Public Property Let FontSize(ByVal lSiz As Single)
PropertyChanged "FontSize"
lblCap.FontSize = lSiz
UserControl_Resize
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
lblCap.Caption = PropBag.ReadProperty("Caption", "")
lblCap.FontSize = PropBag.ReadProperty("FontSize", lblCap.FontSize)
UserControl_Resize
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Caption", lblCap.Caption
PropBag.WriteProperty "FontSize", lblCap.FontSize
End Sub