📄 usercontrol11.ctl
字号:
VERSION 5.00
Begin VB.UserControl UserControl11
ClientHeight = 5835
ClientLeft = 0
ClientTop = 0
ClientWidth = 8985
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Picture = "UserControl11.ctx":0000
ScaleHeight = 5835
ScaleWidth = 8985
Begin VB.Label Label2
BackStyle = 0 'Transparent
Height = 1005
Left = 570
TabIndex = 1
Top = 390
Width = 1275
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "weqw3e23"
BeginProperty Font
Name = "隶书"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 825
Left = 780
TabIndex = 0
Top = 600
Width = 1095
End
End
Attribute VB_Name = "UserControl11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim pot() As POINTAPI
Dim n As Integer
'缺省属性值:
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_property = 0
Public m_def_caption As Variant
Private Const ALTERNATE = 1
'属性变量:
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_property As Variant
Dim m_caption As String
Private m_fillmode As Long
'事件声明:
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 = "当用户在拥有焦点的对象上释放鼠标发生。"
Event WriteProperties(PropBag As PropertyBag)
Attribute WriteProperties.VB_Description = "当要求用户控件或用户文档向一个文件写入数据时发生。"
Event ReadProperties(PropBag As PropertyBag)
Attribute ReadProperties.VB_Description = "当要求用户控件或用户文档从一个文件中读取数据时发生。"
'注意!不要删除或修改下列被注释的行!
'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
Public Property Get caption() As String
caption = Label1.caption
End Property
Public Property Let caption(ByVal c As String)
Label1.caption = c
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
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,ActiveControl
Public Property Get ActiveControl() As Object
Attribute ActiveControl.VB_Description = "返回拥有焦点的控件。"
Set ActiveControl = UserControl.ActiveControl
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=0
Public Function CanPropertyChange(ByVal PropertyName As String) As Boolean
Attribute CanPropertyChange.VB_Description = "查询用户控件的容器是否能够改变绑定到数据源的属性。如果在 PropertyName 中指定的属性被绑定到数据源, CanPropertyChange 方法是最有用的。"
End Function
'注意!不要删除或修改下列被注释的行!
'MemberInfo=14,0,0,0
Public Property Get property() As Variant
property = m_property
End Property
Public Property Let property(ByVal New_property As Variant)
m_property = New_property
PropertyChanged "property"
End Property
Private Sub Label2_Click()
RaiseEvent Click
End Sub
'为用户控件初始化属性
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_property = m_def_property
End Sub
Private Sub UserControl_Paint()
Label1.caption = m_def_caption
m_fillmode = ALTERNATE
Dim hRgn As Long
n = 103
ReDim pot(0 To n)
pot(0).X = 25.71428: pot(0).Y = 99.64286
pot(1).X = 25.71428: pot(1).Y = 98.57143
pot(2).X = 25.71428: pot(2).Y = 95.35714
pot(3).X = 27.85714: pot(3).Y = 92.14286
pot(4).X = 28.92857: pot(4).Y = 88.92857
pot(5).X = 28.92857: pot(5).Y = 85.71429
pot(6).X = 31.07143: pot(6).Y = 83.57143
pot(7).X = 31.07143: pot(7).Y = 81.42857
pot(8).X = 31.07143: pot(8).Y = 79.28571
pot(9).X = 32.14286: pot(9).Y = 77.14286
pot(10).X = 33.21429: pot(10).Y = 75
pot(11).X = 34.28571: pot(11).Y = 72.85714
pot(12).X = 35.35714: pot(12).Y = 71.78571
pot(13).X = 35.35714: pot(13).Y = 70.71429
pot(14).X = 37.5: pot(14).Y = 68.57143
pot(15).X = 37.5: pot(15).Y = 65.35714
pot(16).X = 39.64286: pot(16).Y = 62.14286
pot(17).X = 40.71429: pot(17).Y = 60
pot(18).X = 42.85714: pot(18).Y = 56.78571
pot(19).X = 43.92857: pot(19).Y = 53.57143
pot(20).X = 45: pot(20).Y = 51.42857
pot(21).X = 46.07143: pot(21).Y = 49.28571
pot(22).X = 47.14286: pot(22).Y = 47.14286
pot(23).X = 50.35714: pot(23).Y = 45
pot(24).X = 52.5: pot(24).Y = 42.85714
pot(25).X = 54.64286: pot(25).Y = 40.71429
pot(26).X = 55.71429: pot(26).Y = 38.57143
pot(27).X = 57.85714: pot(27).Y = 37.5
pot(28).X = 58.92857: pot(28).Y = 36.42857
pot(29).X = 61.07143: pot(29).Y = 35.35714
pot(30).X = 63.21429: pot(30).Y = 34.28571
pot(31).X = 67.5: pot(31).Y = 32.14286
pot(32).X = 69.64286: pot(32).Y = 30
pot(33).X = 72.85714: pot(33).Y = 28.92857
pot(34).X = 76.07143: pot(34).Y = 27.85714
pot(35).X = 80.35714: pot(35).Y = 26.78572
pot(36).X = 82.5: pot(36).Y = 25.71428
pot(37).X = 86.78571: pot(37).Y = 24.64286
pot(38).X = 88.92857: pot(38).Y = 23.57143
pot(39).X = 92.14286: pot(39).Y = 23.57143
pot(40).X = 95.35714: pot(40).Y = 21.42857
pot(41).X = 101.7857: pot(41).Y = 20.35714
pot(42).X = 103.9286: pot(42).Y = 19.28572
pot(43).X = 108.2143: pot(43).Y = 17.14286
pot(44).X = 112.5: pot(44).Y = 18.21428
pot(45).X = 118.9286: pot(45).Y = 18.21428
pot(46).X = 122.1429: pot(46).Y = 20.35714
pot(47).X = 126.4286: pot(47).Y = 22.5
pot(48).X = 129.6429: pot(48).Y = 25.71428
pot(49).X = 133.9286: pot(49).Y = 27.85714
pot(50).X = 135: pot(50).Y = 30
pot(51).X = 137.1429: pot(51).Y = 32.14286
pot(52).X = 138.2143: pot(52).Y = 35.35714
pot(53).X = 140.3571: pot(53).Y = 37.5
pot(54).X = 142.5: pot(54).Y = 40.71429
pot(55).X = 144.6429: pot(55).Y = 42.85714
pot(56).X = 147.8571: pot(56).Y = 46.07143
pot(57).X = 148.9286: pot(57).Y = 48.21429
pot(58).X = 151.0714: pot(58).Y = 48.21429
pot(59).X = 155.3571: pot(59).Y = 52.5
pot(60).X = 155.3571: pot(60).Y = 54.64286
pot(61).X = 154.2857: pot(61).Y = 53.57143
pot(62).X = 152.1429: pot(62).Y = 52.5
pot(63).X = 150: pot(63).Y = 52.5
pot(64).X = 146.7857: pot(64).Y = 52.5
pot(65).X = 144.6429: pot(65).Y = 52.5
pot(66).X = 143.5714: pot(66).Y = 53.57143
pot(67).X = 141.4286: pot(67).Y = 55.71429
pot(68).X = 140.3571: pot(68).Y = 56.78571
pot(69).X = 137.1429: pot(69).Y = 58.92857
pot(70).X = 135: pot(70).Y = 61.07143
pot(71).X = 132.8571: pot(71).Y = 63.21429
pot(72).X = 129.6429: pot(72).Y = 64.28571
pot(73).X = 128.5714: pot(73).Y = 66.42857
pot(74).X = 128.5714: pot(74).Y = 68.57143
pot(75).X = 126.4286: pot(75).Y = 70.71429
pot(76).X = 124.2857: pot(76).Y = 71.78571
pot(77).X = 122.1429: pot(77).Y = 76.07143
pot(78).X = 120: pot(78).Y = 78.21429
pot(79).X = 116.7857: pot(79).Y = 82.5
pot(80).X = 113.5714: pot(80).Y = 83.57143
pot(81).X = 109.2857: pot(81).Y = 85.71429
pot(82).X = 107.1429: pot(82).Y = 87.85714
pot(83).X = 103.9286: pot(83).Y = 91.07143
pot(84).X = 98.57143: pot(84).Y = 94.28571
pot(85).X = 91.07143: pot(85).Y = 97.5
pot(86).X = 85.71429: pot(86).Y = 99.64286
pot(87).X = 78.21429: pot(87).Y = 103.9286
pot(88).X = 75: pot(88).Y = 105
pot(89).X = 69.64286: pot(89).Y = 106.0714
pot(90).X = 66.42857: pot(90).Y = 105
pot(91).X = 62.14286: pot(91).Y = 103.9286
pot(92).X = 54.64286: pot(92).Y = 102.8571
pot(93).X = 48.21429: pot(93).Y = 100.7143
pot(94).X = 42.85714: pot(94).Y = 98.57143
pot(95).X = 38.57143: pot(95).Y = 95.35714
pot(96).X = 35.35714: pot(96).Y = 94.28571
pot(97).X = 32.14286: pot(97).Y = 94.28571
pot(98).X = 33.21429: pot(98).Y = 95.35714
pot(99).X = 31.07143: pot(99).Y = 99.64286
pot(100).X = 27.85714: pot(100).Y = 99.64286
pot(101).X = 27.85714: pot(101).Y = 96.42857
pot(102).X = 27.85714: pot(102).Y = 92.14286
pot(103).X = 27.85714: pot(103).Y = 88.92857
hRgn = CreatePolygonRgn(pot(0), n, m_fillmode)
SetWindowRgn hWnd, hRgn, True
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_property = PropBag.ReadProperty("property", m_def_property)
m_caption = PropBag.ReadProperty("caption", m_def_caption)
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("property", m_property, m_def_property)
Call PropBag.WriteProperty("caption", m_caption, m_def_caption)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -