📄 usercontrol6.ctl
字号:
VERSION 5.00
Begin VB.UserControl OSXChk
BackColor = &H00FFFFFF&
ClientHeight = 3600
ClientLeft = 0
ClientTop = 0
ClientWidth = 4800
ScaleHeight = 3600
ScaleWidth = 4800
Begin VB.TextBox Text1
Height = 285
Left = 1560
TabIndex = 2
Text = "0"
Top = 840
Width = 1215
End
Begin VB.Image Image6
Height = 195
Left = 600
Picture = "UserControl6.ctx":0000
Top = 1560
Width = 165
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Height = 255
Left = 0
TabIndex = 1
Top = 0
Width = 1215
End
Begin VB.Image Image5
Height = 195
Left = 960
Picture = "UserControl6.ctx":0216
Top = 1320
Width = 165
End
Begin VB.Image Image4
Height = 195
Left = 960
Picture = "UserControl6.ctx":042C
Top = 1080
Width = 165
End
Begin VB.Image Image3
Height = 195
Left = 600
Picture = "UserControl6.ctx":0642
Top = 1320
Width = 165
End
Begin VB.Image Image2
Height = 195
Left = 600
Picture = "UserControl6.ctx":0858
Top = 1080
Width = 165
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "OS X Check"
Height = 255
Left = 240
TabIndex = 0
Top = 30
Width = 1335
End
Begin VB.Image Image1
Height = 195
Left = 0
Picture = "UserControl6.ctx":0A6E
Top = 0
Width = 165
End
End
Attribute VB_Name = "OSXChk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Event Declarations:
Event Click() 'MappingInfo=Label2,Label2,-1,Click
Attribute Click.VB_Description = "Occurs when the user presses and then releases a mouse button over an object."
Event DblClick() 'MappingInfo=Label2,Label2,-1,DblClick
Attribute DblClick.VB_Description = "Occurs when the user presses and releases a mouse button and then presses and releases it again over an object."
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=Label2,Label2,-1,MouseDown
Attribute MouseDown.VB_Description = "Occurs when the user presses the mouse button while an object has the focus."
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=Label2,Label2,-1,MouseMove
Attribute MouseMove.VB_Description = "Occurs when the user moves the mouse."
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=Label2,Label2,-1,MouseUp
Attribute MouseUp.VB_Description = "Occurs when the user releases the mouse button while an object has the focus."
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Value = False Then
Image1.Picture = Image2.Picture
Else
Image1.Picture = Image3.Picture
End If
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Value = False Then
Image1.Picture = Image2.Picture
Else
Image1.Picture = Image3.Picture
End If
End Sub
Private Sub Label2_Click()
RaiseEvent Click
If Text1.Text = "0" Then
Image1.Picture = Image5.Picture
Text1.Text = 1
Else
Image1.Picture = Image4.Picture
Text1.Text = 0
End If
End Sub
Private Sub Label2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, Shift, X, Y)
If Text1.Text = "0" Then
Image1.Picture = Image2.Picture
Text1.Text = 1
Else
Image1.Picture = Image3.Picture
Text1.Text = 0
End If
End Sub
Private Sub Label2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, Shift, X, Y)
If Text1.Text = "0" Then
Image1.Picture = Image2.Picture
Text1.Text = 1
Else
Image1.Picture = Image3.Picture
Text1.Text = 0
End If
End Sub
Private Sub Text1_Change()
End Sub
Private Sub UserControl_Resize()
Label2.Width = UserControl.Width
Label1.Width = UserControl.Width
Label2.Top = UserControl.Height / 2 - 100
Label1.Top = UserControl.Height / 2 - 100
Image1.Top = UserControl.Height / 2 - 100
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,BackColor
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "Returns/sets the background color used to display text and graphics in an object."
BackColor = UserControl.BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
UserControl.BackColor() = New_BackColor
PropertyChanged "BackColor"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Label1,Label1,-1,ForeColor
Public Property Get ForeColor() As OLE_COLOR
Attribute ForeColor.VB_Description = "Returns/sets the foreground color used to display text and graphics in an object."
ForeColor = Label1.ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
Label1.ForeColor() = New_ForeColor
PropertyChanged "ForeColor"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Label2,Label2,-1,Enabled
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
Enabled = Label2.Enabled
If Enabled = False Then
Image1.Picture = Image6.Picture
Else
Image1.Picture = Image2.Picture
End If
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
Label2.Enabled() = New_Enabled
PropertyChanged "Enabled"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Label1,Label1,-1,Font
Public Property Get Font() As Font
Attribute Font.VB_Description = "Returns a Font object."
Attribute Font.VB_UserMemId = -512
Set Font = Label1.Font
End Property
Public Property Set Font(ByVal New_Font As Font)
Set Label1.Font = New_Font
PropertyChanged "Font"
End Property
Private Sub Label2_DblClick()
RaiseEvent DblClick
End Sub
Private Sub Label2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Label1,Label1,-1,Caption
Public Property Get Caption() As String
Attribute Caption.VB_Description = "Returns/sets the text displayed in an object's title bar or below an object's icon."
Caption = Label1.Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
Label1.Caption() = New_Caption
PropertyChanged "Caption"
End Property
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
UserControl.BackColor = PropBag.ReadProperty("BackColor", &HFFFFFF)
Label1.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
Label2.Enabled = PropBag.ReadProperty("Enabled", True)
Set Label1.Font = PropBag.ReadProperty("Font", Ambient.Font)
Label1.Caption = PropBag.ReadProperty("Caption", "OS X Check")
Text1.Text = PropBag.ReadProperty("Value", "0")
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &HFFFFFF)
Call PropBag.WriteProperty("ForeColor", Label1.ForeColor, &H80000012)
Call PropBag.WriteProperty("Enabled", Label2.Enabled, True)
Call PropBag.WriteProperty("Font", Label1.Font, Ambient.Font)
Call PropBag.WriteProperty("Caption", Label1.Caption, "OS X Check")
Call PropBag.WriteProperty("Value", Text1.Text, "0")
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=Text1,Text1,-1,Text
Public Property Get Value() As String
Value = Text1.Text
End Property
Public Property Let Value(ByVal New_Value As String)
Text1.Text() = New_Value
PropertyChanged "Value"
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -