📄 lcommandbutton.ctl
字号:
PropertyChanged "MouseIcon"
End Property
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Image1,Image1,-1,MousePointer
Public Property Get MousePointer() As Integer
Attribute MousePointer.VB_Description = "返回/设置当鼠标经过对象某一部分时鼠标的指针类型。"
MousePointer = Image1.MousePointer
End Property
Public Property Let MousePointer(ByVal New_MousePointer As Integer)
Image1.MousePointer() = New_MousePointer
PropertyChanged "MousePointer"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Image1,Image1,-1,Stretch
Public Property Get Stretch() As Boolean
Attribute Stretch.VB_Description = "返回/设置一个值,决定是否调整图形的大小以适应图像控件。"
Stretch = Image2.Stretch
End Property
Public Property Let Stretch(ByVal New_Stretch As Boolean)
Image2.Stretch() = New_Stretch
PropertyChanged "Stretch"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Image1,Image1,-1,Picture
Public Property Get Picture() As Picture
Attribute Picture.VB_Description = "返回/设置控件中显示的图形。"
Set Picture = Image2.Picture
End Property
Public Property Set Picture(ByVal New_Picture As Picture)
Set Image2.Picture = New_Picture
PropertyChanged "Picture"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=14
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
UserControl.AutoRedraw = PropBag.ReadProperty("AutoRedraw", False)
Image2.Stretch = PropBag.ReadProperty("AutoSize", False)
Line1(0).BorderColor = PropBag.ReadProperty("BorderColor", 16777215)
Line1(0).BorderStyle = PropBag.ReadProperty("BorderStyle", 1)
Line1(0).BorderWidth = PropBag.ReadProperty("BorderWidth", 1)
Label1.Caption = PropBag.ReadProperty("Caption", "LCommandButtonCption")
UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
Label1.Enabled = UserControl.Enabled
Set Label1.Font = PropBag.ReadProperty("Font", Ambient.Font)
Label1.FontBold = PropBag.ReadProperty("FontBold", 0)
Label1.FontItalic = PropBag.ReadProperty("FontItalic", 0)
Label1.FontStrikethru = PropBag.ReadProperty("FontStrikethru", 0)
Label1.FontUnderline = PropBag.ReadProperty("FontUnderline", 0)
Label1.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
Set MouseIcon = PropBag.ReadProperty("MouseIcon", Nothing)
Image1.MousePointer = PropBag.ReadProperty("MousePointer", 0)
Image2.Stretch = PropBag.ReadProperty("Stretch", False)
Set Picture = PropBag.ReadProperty("Picture", Nothing)
Image2.Left = Image1.Left
Image2.Top = (Image1.Height - Image2.Height) / 2
Label2.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
Bcolor = Label2.BackColor
Label2.BackStyle = PropBag.ReadProperty("BackStyle", 1)
Label1.Alignment = PropBag.ReadProperty("Alignment", 2)
Line1(0).BorderStyle = PropBag.ReadProperty("TopBorderStyle", 1)
Line1(0).BorderColor = PropBag.ReadProperty("TopBorderColor", 16777215)
Line1(0).BorderWidth = PropBag.ReadProperty("TopBorderWidth", 1)
Line1(2).BorderStyle = PropBag.ReadProperty("DownBorderStyle", 1)
Line1(2).BorderColor = PropBag.ReadProperty("DownBorderColor", 16777215)
Line1(2).BorderWidth = PropBag.ReadProperty("DownBorderWidth", 1)
Line1(1).BorderStyle = PropBag.ReadProperty("LeftBorderStyle", 1)
Line1(1).BorderColor = PropBag.ReadProperty("LeftBorderColor", 16777215)
Line1(1).BorderWidth = PropBag.ReadProperty("LeftBorderWidth", 1)
Line1(3).BorderStyle = PropBag.ReadProperty("RightBorderStyle", 1)
Line1(3).BorderColor = PropBag.ReadProperty("RightBorderColor", 16777215)
Line1(3).BorderWidth = PropBag.ReadProperty("RightBorderWidth", 1)
Image2.Left = PropBag.ReadProperty("PictureLeft", 0)
Image2.Top = PropBag.ReadProperty("PictureTop", 0)
Image2.Height = PropBag.ReadProperty("PictureHeight", 0)
Image2.Width = PropBag.ReadProperty("PictureWidth", 0)
End Sub
'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("AutoRedraw", UserControl.AutoRedraw, False)
Call PropBag.WriteProperty("AutoSize", Image2.Stretch, False)
Call PropBag.WriteProperty("BorderColor", Line1(0).BorderColor, 16777215)
Call PropBag.WriteProperty("BorderStyle", Line1(0).BorderStyle, 1)
Call PropBag.WriteProperty("BorderWidth", Line1(0).BorderWidth, 1)
Call PropBag.WriteProperty("Caption", Label1.Caption, "LCommandButtonCption")
Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True)
Call PropBag.WriteProperty("Font", Label1.Font, Ambient.Font)
Call PropBag.WriteProperty("FontBold", Label1.FontBold, 0)
Call PropBag.WriteProperty("FontItalic", Label1.FontItalic, 0)
Call PropBag.WriteProperty("FontSize", Label1.FontSize, 0)
Call PropBag.WriteProperty("FontStrikethru", Label1.FontStrikethru, 0)
Call PropBag.WriteProperty("FontUnderline", Label1.FontUnderline, 0)
Call PropBag.WriteProperty("ForeColor", Label1.ForeColor, &H80000012)
Call PropBag.WriteProperty("MouseIcon", MouseIcon, Nothing)
Call PropBag.WriteProperty("MousePointer", Image1.MousePointer, 0)
Call PropBag.WriteProperty("Stretch", Image2.Stretch, False)
Call PropBag.WriteProperty("Picture", Picture, Nothing)
Call PropBag.WriteProperty("BackColor", Label2.BackColor, &H8000000F)
Call PropBag.WriteProperty("BackStyle", Label2.BackStyle, 1)
Call PropBag.WriteProperty("Alignment", Label1.Alignment, 2)
Call PropBag.WriteProperty("TopBorderStyle", Line1(0).BorderStyle, 1)
Call PropBag.WriteProperty("TopBorderColor", Line1(0).BorderColor, 16777215)
Call PropBag.WriteProperty("TopBorderWidth", Line1(0).BorderWidth, 1)
Call PropBag.WriteProperty("DownBorderStyle", Line1(2).BorderStyle, 1)
Call PropBag.WriteProperty("DownBorderColor", Line1(2).BorderColor, 16777215)
Call PropBag.WriteProperty("DownBorderWidth", Line1(2).BorderWidth, 1)
Call PropBag.WriteProperty("LeftBorderStyle", Line1(1).BorderStyle, 1)
Call PropBag.WriteProperty("LeftBorderColor", Line1(1).BorderColor, 16777215)
Call PropBag.WriteProperty("LeftBorderWidth", Line1(1).BorderWidth, 1)
Call PropBag.WriteProperty("RightBorderStyle", Line1(3).BorderStyle, 1)
Call PropBag.WriteProperty("RightBorderColor", Line1(3).BorderColor, 16777215)
Call PropBag.WriteProperty("RightBorderWidth", Line1(3).BorderWidth, 1)
Call PropBag.WriteProperty("PictureLeft", Image2.Left, 0)
Call PropBag.WriteProperty("PictureTop", Image2.Top, 0)
Call PropBag.WriteProperty("PictureHeight", Image2.Height, 0)
Call PropBag.WriteProperty("PictureWidth", Image2.Width, 0)
End Sub
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Label2,Label2,-1,BackColor
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "返回/设置对象中文本和图形的背景色。"
BackColor = Label2.BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
Label2.BackColor() = New_BackColor
PropertyChanged "BackColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Label2,Label2,-1,BackStyle
Public Property Get BackStyle() As Integer
Attribute BackStyle.VB_Description = "指出 Label 或 Shape 的背景样式是透明的还是不透明的。"
BackStyle = Label2.BackStyle
End Property
Public Property Let BackStyle(ByVal New_BackStyle As Integer)
Label2.BackStyle() = New_BackStyle
PropertyChanged "BackStyle"
End Property
'为用户控件初始化属性
Private Sub UserControl_InitProperties()
Image2.Left = Image1.Left
Image2.Top = Image1.Top + (Image1.Height - Image2.Height) / 2
End Sub
'
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Label1,Label1,-1,Alignment
Public Property Get Alignment() As Integer
Attribute Alignment.VB_Description = "返回/设置复选框或选项按钮、或一个控件的文本的对齐。"
Alignment = Label1.Alignment
End Property
Public Property Let Alignment(ByVal New_Alignment As Integer)
Label1.Alignment() = New_Alignment
PropertyChanged "Alignment"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(0),Line1,0,BorderStyle
Public Property Get TopBorderStyle() As Integer
Attribute TopBorderStyle.VB_Description = "返回/设置对象的边框样式。"
TopBorderStyle = Line1(0).BorderStyle
End Property
Public Property Let TopBorderStyle(ByVal New_TopBorderStyle As Integer)
Line1(0).BorderStyle() = New_TopBorderStyle
PropertyChanged "TopBorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(0),Line1,0,BorderColor
Public Property Get TopBorderColor() As Long
Attribute TopBorderColor.VB_Description = "返回/设置对象的边框颜色。"
TopBorderColor = Line1(0).BorderColor
End Property
Public Property Let TopBorderColor(ByVal New_TopBorderColor As Long)
Line1(0).BorderColor() = New_TopBorderColor
PropertyChanged "TopBorderColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(0),Line1,0,BorderWidth
Public Property Get TopBorderWidth() As Integer
Attribute TopBorderWidth.VB_Description = "返回/设置控件的边框宽度。"
TopBorderWidth = Line1(0).BorderWidth
End Property
Public Property Let TopBorderWidth(ByVal New_TopBorderWidth As Integer)
Line1(0).BorderWidth() = New_TopBorderWidth
PropertyChanged "TopBorderWidth"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(2),Line1,2,BorderStyle
Public Property Get DownBorderStyle() As Integer
Attribute DownBorderStyle.VB_Description = "返回/设置对象的边框样式。"
DownBorderStyle = Line1(2).BorderStyle
End Property
Public Property Let DownBorderStyle(ByVal New_DownBorderStyle As Integer)
Line1(2).BorderStyle() = New_DownBorderStyle
PropertyChanged "DownBorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(2),Line1,2,BorderColor
Public Property Get DownBorderColor() As Long
Attribute DownBorderColor.VB_Description = "返回/设置对象的边框颜色。"
DownBorderColor = Line1(2).BorderColor
End Property
Public Property Let DownBorderColor(ByVal New_DownBorderColor As Long)
Line1(2).BorderColor() = New_DownBorderColor
PropertyChanged "DownBorderColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(2),Line1,2,BorderWidth
Public Property Get DownBorderWidth() As Integer
Attribute DownBorderWidth.VB_Description = "返回/设置控件的边框宽度。"
DownBorderWidth = Line1(2).BorderWidth
End Property
Public Property Let DownBorderWidth(ByVal New_DownBorderWidth As Integer)
Line1(2).BorderWidth() = New_DownBorderWidth
PropertyChanged "DownBorderWidth"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(1),Line1,1,BorderStyle
Public Property Get LeftBorderStyle() As Integer
Attribute LeftBorderStyle.VB_Description = "返回/设置对象的边框样式。"
LeftBorderStyle = Line1(1).BorderStyle
End Property
Public Property Let LeftBorderStyle(ByVal New_LeftBorderStyle As Integer)
Line1(1).BorderStyle() = New_LeftBorderStyle
PropertyChanged "LeftBorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(1),Line1,1,BorderColor
Public Property Get LeftBorderColor() As Long
Attribute LeftBorderColor.VB_Description = "返回/设置对象的边框颜色。"
LeftBorderColor = Line1(1).BorderColor
End Property
Public Property Let LeftBorderColor(ByVal New_LeftBorderColor As Long)
Line1(1).BorderColor() = New_LeftBorderColor
PropertyChanged "LeftBorderColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(1),Line1,1,BorderWidth
Public Property Get LeftBorderWidth() As Integer
Attribute LeftBorderWidth.VB_Description = "返回/设置控件的边框宽度。"
LeftBorderWidth = Line1(1).BorderWidth
End Property
Public Property Let LeftBorderWidth(ByVal New_LeftBorderWidth As Integer)
Line1(1).BorderWidth() = New_LeftBorderWidth
PropertyChanged "LeftBorderWidth"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderStyle
Public Property Get RightBorderStyle() As Integer
Attribute RightBorderStyle.VB_Description = "返回/设置对象的边框样式。"
RightBorderStyle = Line1(3).BorderStyle
End Property
Public Property Let RightBorderStyle(ByVal New_RightBorderStyle As Integer)
Line1(3).BorderStyle() = New_RightBorderStyle
PropertyChanged "RightBorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderColor
Public Property Get RightBorderColor() As Long
Attribute RightBorderColor.VB_Description = "返回/设置对象的边框颜色。"
RightBorderColor = Line1(3).BorderColor
End Property
Public Property Let RightBorderColor(ByVal New_RightBorderColor As Long)
Line1(3).BorderColor() = New_RightBorderColor
PropertyChanged "RightBorderColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderWidth
Public Property Get RightBorderWidth() As Integer
Attribute RightBorderWidth.VB_Description = "返回/设置控件的边框宽度。"
RightBorderWidth = Line1(3).BorderWidth
End Property
Public Property Let RightBorderWidth(ByVal New_RightBorderWidth As Integer)
Line1(3).BorderWidth() = New_RightBorderWidth
PropertyChanged "RightBorderWidth"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderWidth
Public Property Get PictureLeft() As Integer
PictureLeft = Image2.Left()
End Property
Public Property Let PictureLeft(ByVal New_PictureLeft As Integer)
Image2.Left() = New_PictureLeft
PropertyChanged "PictureLeft"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderWidth
Public Property Get PictureTop() As Integer
PictureTop = Image2.Top()
End Property
Public Property Let PictureTop(ByVal New_PictureTop As Integer)
Image2.Top() = New_PictureTop
PropertyChanged "PictureTop"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderWidth
Public Property Get PictureHeight() As Integer
PictureHeight = Image2.Height()
End Property
Public Property Let PictureHeight(ByVal New_PictureHeight As Integer)
Image2.Height() = New_PictureHeight
PropertyChanged "PictureHeight"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=Line1(3),Line1,3,BorderWidth
Public Property Get PictureWidth() As Integer
PictureWidth = Image2.Width()
End Property
Public Property Let PictureWidth(ByVal New_PictureWidth As Integer)
Image2.Width() = New_PictureWidth
PropertyChanged "PictureWidth"
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -