📄 ctlbar.ctl
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.UserControl ctlBar
AutoRedraw = -1 'True
BackStyle = 0 '透明
ClientHeight = 555
ClientLeft = 0
ClientTop = 0
ClientWidth = 2055
DefaultCancel = -1 'True
FillStyle = 0 'Solid
ForwardFocus = -1 'True
ScaleHeight = 555
ScaleWidth = 2055
ToolboxBitmap = "ctlBar.ctx":0000
Begin MSComctlLib.ImageList ImageList1
Left = 2220
Top = 30
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "ctlBar.ctx":0312
Key = ""
EndProperty
EndProperty
End
Begin VB.Image Image1
Height = 480
Left = 30
Picture = "ctlBar.ctx":076A
Stretch = -1 'True
Top = 30
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Label1"
ForeColor = &H00C00000&
Height = 180
Left = 600
TabIndex = 0
Top = 150
Width = 540
End
Begin VB.Line Line4
BorderColor = &H8000000C&
X1 = 0
X2 = 0
Y1 = 0
Y2 = 630
End
Begin VB.Line Line3
BorderColor = &H8000000C&
BorderWidth = 2
Visible = 0 'False
X1 = 0
X2 = 2070
Y1 = 0
Y2 = 0
End
Begin VB.Line Line2
BorderColor = &H80000003&
Visible = 0 'False
X1 = 2040
X2 = 2040
Y1 = -30
Y2 = 600
End
Begin VB.Line Line1
BorderColor = &H80000003&
BorderWidth = 2
Visible = 0 'False
X1 = 30
X2 = 2055
Y1 = 555
Y2 = 540
End
End
Attribute VB_Name = "ctlBar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'缺省属性值:
Const m_def_BackColor = 0
Const m_def_ForeColor = 0
Const m_def_Enabled = 0
Const m_def_BackStyle = 0
Const m_def_BorderStyle = 0
'Const m_def_LineLeftColor = 0
'Const m_def_LineRightColor = 0
'Const m_def_LineTopColor = 0
'Const m_def_LineBottomColor = 0
'属性变量:
Dim m_BackColor As Long
Dim m_ForeColor As Long
Dim m_Enabled As Boolean
Dim m_Font As Font
Dim m_BackStyle As Integer
Dim m_BorderStyle As Integer
'Dim m_LineLeftColor As Variant
'Dim m_LineRightColor As Variant
'Dim m_LineTopColor As Variant
'Dim m_LineBottomColor As Variant
'事件声明:
Event Click()
Attribute Click.VB_Description = "当用户在一个对象上按下并释放鼠标按钮时发生。"
Event DblClick()
Attribute DblClick.VB_Description = "当用户在一个对象上按下并释放鼠标按钮后再次按下并释放鼠标按钮时发生。"
Event KeyDown(KeyCode As Integer, Shift As Integer)
Attribute KeyDown.VB_Description = "当用户在拥有焦点的对象上按下任意键时发生。"
Event KeyPress(KeyAscii As Integer)
Attribute KeyPress.VB_Description = "当用户按下和释放 ANSI 键时发生。"
Event KeyUp(KeyCode As Integer, Shift As Integer)
Attribute KeyUp.VB_Description = "当用户在拥有焦点的对象上释放键时发生。"
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseDown.VB_Description = "当用户在拥有焦点的对象上按下鼠标按钮时发生。"
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseMove.VB_Description = "当用户移动鼠标时发生。"
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseUp.VB_Description = "当用户在拥有焦点的对象上释放鼠标发生。"
Public Event cLostFocus()
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = True
Line1.BorderColor = vbWhite
Line2.Visible = True
Line2.BorderColor = vbWhite
Line3.Visible = True
Line3.BorderColor = vbBlack
Line4.Visible = True
Line4.BorderColor = vbBlack
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = True
Line1.BorderColor = vbWhite
Line2.Visible = True
Line2.BorderColor = vbWhite
Line3.Visible = True
Line3.BorderColor = vbBlack
Line4.Visible = True
Line4.BorderColor = vbBlack
End Sub
Private Sub UserControl_GotFocus()
End Sub
Private Sub UserControl_LostFocus()
Line1.Visible = False
Line2.Visible = False
Line3.Visible = False
Line4.Visible = False
End Sub
'注意!不要删除或修改下列被注释的行!
'MemberInfo=8,0,0,0
Public Property Get BackColor() As Long
Attribute BackColor.VB_Description = "返回/设置对象中文本和图形的背景色。"
BackColor = m_BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As Long)
m_BackColor = New_BackColor
PropertyChanged "BackColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=8,0,0,0
Public Property Get ForeColor() As Long
Attribute ForeColor.VB_Description = "返回/设置对象中文本和图形的前景色。"
ForeColor = m_ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As Long)
m_ForeColor = New_ForeColor
PropertyChanged "ForeColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=0,0,0,0
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "返回/设置一个值,决定一个对象是否响应用户生成事件。"
Enabled = m_Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
m_Enabled = New_Enabled
PropertyChanged "Enabled"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=6,0,0,0
Public Property Get Font() As Font
Attribute Font.VB_Description = "返回一个 Font 对象。"
Attribute Font.VB_UserMemId = -512
Set Font = m_Font
End Property
Public Property Set Font(ByVal New_Font As Font)
Set m_Font = New_Font
PropertyChanged "Font"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get BackStyle() As Integer
Attribute BackStyle.VB_Description = "指出 Label 或 Shape 的背景样式是透明的还是不透明的。"
BackStyle = m_BackStyle
End Property
Public Property Let BackStyle(ByVal New_BackStyle As Integer)
m_BackStyle = New_BackStyle
PropertyChanged "BackStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get BorderStyle() As Integer
Attribute BorderStyle.VB_Description = "返回/设置对象的边框样式。"
BorderStyle = m_BorderStyle
End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As Integer)
m_BorderStyle = New_BorderStyle
PropertyChanged "BorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=5
Public Sub Refresh()
Attribute Refresh.VB_Description = "强制完全重画一个对象。"
End Sub
'
''注意!不要删除或修改下列被注释的行!
''MemberInfo=14,0,0,0
'Public Property Get LineLeftColor() As Variant
' LineLeftColor = m_LineLeftColor
'End Property
'
'Public Property Let LineLeftColor(ByVal New_LineLeftColor As Variant)
' m_LineLeftColor = New_LineLeftColor
' PropertyChanged "LineLeftColor"
'End Property
'
''注意!不要删除或修改下列被注释的行!
''MemberInfo=14,0,0,0
'Public Property Get LineRightColor() As Variant
' LineRightColor = m_LineRightColor
'End Property
'
'Public Property Let LineRightColor(ByVal New_LineRightColor As Variant)
' m_LineRightColor = New_LineRightColor
' PropertyChanged "LineRightColor"
'End Property
'
''注意!不要删除或修改下列被注释的行!
''MemberInfo=14,0,0,0
'Public Property Get LineTopColor() As Variant
' LineTopColor = m_LineTopColor
'End Property
'
'Public Property Let LineTopColor(ByVal New_LineTopColor As Variant)
' m_LineTopColor = New_LineTopColor
' PropertyChanged "LineTopColor"
'End Property
'
''注意!不要删除或修改下列被注释的行!
''MemberInfo=14,0,0,0
'Public Property Get LineBottomColor() As Variant
' LineBottomColor = m_LineBottomColor
'End Property
'
'Public Property Let LineBottomColor(ByVal New_LineBottomColor As Variant)
' m_LineBottomColor = New_LineBottomColor
' PropertyChanged "LineBottomColor"
'End Property
'为用户控件初始化属性
Private Sub UserControl_InitProperties()
m_BackColor = m_def_BackColor
m_ForeColor = m_def_ForeColor
m_Enabled = m_def_Enabled
Set m_Font = Ambient.Font
m_BackStyle = m_def_BackStyle
m_BorderStyle = m_def_BorderStyle
' m_LineLeftColor = m_def_LineLeftColor
' m_LineRightColor = m_def_LineRightColor
' m_LineTopColor = m_def_LineTopColor
' m_LineBottomColor = m_def_LineBottomColor
End Sub
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Line1.Visible = True
Line1.BorderColor = vbWhite
Line2.Visible = True
Line2.BorderColor = vbWhite
Line3.Visible = True
Line3.BorderColor = vbBlack
Line4.Visible = True
Line4.BorderColor = vbBlack
End Sub
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_BackColor = PropBag.ReadProperty("BackColor", m_def_BackColor)
m_ForeColor = PropBag.ReadProperty("ForeColor", m_def_ForeColor)
m_Enabled = PropBag.ReadProperty("Enabled", m_def_Enabled)
Set m_Font = PropBag.ReadProperty("Font", Ambient.Font)
m_BackStyle = PropBag.ReadProperty("BackStyle", m_def_BackStyle)
m_BorderStyle = PropBag.ReadProperty("BorderStyle", m_def_BorderStyle)
' m_LineLeftColor = PropBag.ReadProperty("LineLeftColor", m_def_LineLeftColor)
' m_LineRightColor = PropBag.ReadProperty("LineRightColor", m_def_LineRightColor)
' m_LineTopColor = PropBag.ReadProperty("LineTopColor", m_def_LineTopColor)
' m_LineBottomColor = PropBag.ReadProperty("LineBottomColor", m_def_LineBottomColor)
Line4.BorderColor = PropBag.ReadProperty("LineLeftColor", -2147483643)
Line2.BorderColor = PropBag.ReadProperty("LineRightColor", -2147483645)
Line3.BorderColor = PropBag.ReadProperty("LineTopColor", -2147483636)
Line1.BorderColor = PropBag.ReadProperty("LineBottomColor", -2147483645)
End Sub
'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("BackColor", m_BackColor, m_def_BackColor)
Call PropBag.WriteProperty("ForeColor", m_ForeColor, m_def_ForeColor)
Call PropBag.WriteProperty("Enabled", m_Enabled, m_def_Enabled)
Call PropBag.WriteProperty("Font", m_Font, Ambient.Font)
Call PropBag.WriteProperty("BackStyle", m_BackStyle, m_def_BackStyle)
Call PropBag.WriteProperty("BorderStyle", m_BorderStyle, m_def_BorderStyle)
' Call PropBag.WriteProperty("LineLeftColor", m_LineLeftColor, m_def_LineLeftColor)
' Call PropBag.WriteProperty("LineRightColor", m_LineRightColor, m_def_LineRightColor)
' Call PropBag.WriteProperty("LineTopColor", m_LineTopColor, m_def_LineTopColor)
' Call PropBag.WriteProperty("LineBottomColor", m_LineBottomColor, m_def_LineBottomColor)
Call PropBag.WriteProperty("LineLeftColor", Line4.BorderColor, -2147483643)
Call PropBag.WriteProperty("LineRightColor", Line2.BorderColor, -2147483645)
Call PropBag.WriteProperty("LineTopColor", Line3.BorderColor, -2147483636)
Call PropBag.WriteProperty("LineBottomColor", Line1.BorderColor, -2147483645)
End Sub
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line4,Line4,-1,BorderColor
Public Property Get LineLeftColor() As Long
Attribute LineLeftColor.VB_Description = "返回/设置对象的边框颜色。"
LineLeftColor = Line4.BorderColor
End Property
Public Property Let LineLeftColor(ByVal New_LineLeftColor As Long)
Line4.BorderColor() = New_LineLeftColor
PropertyChanged "LineLeftColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line2,Line2,-1,BorderColor
Public Property Get LineRightColor() As Long
Attribute LineRightColor.VB_Description = "返回/设置对象的边框颜色。"
LineRightColor = Line2.BorderColor
End Property
Public Property Let LineRightColor(ByVal New_LineRightColor As Long)
Line2.BorderColor() = New_LineRightColor
PropertyChanged "LineRightColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line3,Line3,-1,BorderColor
Public Property Get LineTopColor() As Long
Attribute LineTopColor.VB_Description = "返回/设置对象的边框颜色。"
LineTopColor = Line3.BorderColor
End Property
Public Property Let LineTopColor(ByVal New_LineTopColor As Long)
Line3.BorderColor() = New_LineTopColor
PropertyChanged "LineTopColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1,Line1,-1,BorderColor
Public Property Get LineBottomColor() As Long
Attribute LineBottomColor.VB_Description = "返回/设置对象的边框颜色。"
LineBottomColor = Line1.BorderColor
End Property
Public Property Let LineBottomColor(ByVal New_LineBottomColor As Long)
Line1.BorderColor() = New_LineBottomColor
PropertyChanged "LineBottomColor"
End Property
Private Sub cLostDisPlay()
Line1.Visible = False
Line2.Visible = False
Line3.Visible = False
Line4.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -