📄 node.ctl
字号:
VERSION 5.00
Begin VB.UserControl node
AutoRedraw = -1 'True
BackColor = &H00FFFFFF&
ClientHeight = 975
ClientLeft = 0
ClientTop = 0
ClientWidth = 1530
FillStyle = 0 'Solid
MouseIcon = "node.ctx":0000
MousePointer = 99 'Custom
ScaleHeight = 975
ScaleWidth = 1530
End
Attribute VB_Name = "node"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'事件声明:
Event Click() 'MappingInfo=UserControl,UserControl,-1,Click
Attribute Click.VB_Description = "当用户在一个对象上按下并释放鼠标按钮时发生。"
Event DblClick() 'MappingInfo=UserControl,UserControl,-1,DblClick
Attribute DblClick.VB_Description = "当用户在一个对象上按下并释放鼠标按钮后再次按下并释放鼠标按钮时发生。"
Event KeyDown(KeyCode As Integer, Shift As Integer) 'MappingInfo=UserControl,UserControl,-1,KeyDown
Attribute KeyDown.VB_Description = "当用户在拥有焦点的对象上按下任意键时发生。"
Event KeyPress(KeyAscii As Integer) 'MappingInfo=UserControl,UserControl,-1,KeyPress
Attribute KeyPress.VB_Description = "当用户按下和释放 ANSI 键时发生。"
Event KeyUp(KeyCode As Integer, Shift As Integer) 'MappingInfo=UserControl,UserControl,-1,KeyUp
Attribute KeyUp.VB_Description = "当用户在拥有焦点的对象上释放键时发生。"
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseDown
Attribute MouseDown.VB_Description = "当用户在拥有焦点的对象上按下鼠标按钮时发生。"
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseMove
Attribute MouseMove.VB_Description = "当用户移动鼠标时发生。"
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseUp
Attribute MouseUp.VB_Description = "当用户在拥有焦点的对象上释放鼠标发生。"
'缺省属性值:
Const m_def_nodestate = 0
Const m_def_noden1 = 0
Const m_def_noden2 = 0
Const m_def_noden3 = 0
Const m_def_noden4 = 0
Const m_def_isnew = 0
'属性变量:
Dim m_nodestate As Integer
Dim m_noden1 As Integer
Dim m_noden2 As Integer
Dim m_noden3 As Integer
Dim m_noden4 As Integer
Dim m_isnew As Integer
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,BackColor
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "返回/设置对象中文本和图形的背景色。"
BackColor = UserControl.BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
UserControl.BackColor() = New_BackColor
PropertyChanged "BackColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,ForeColor
Public Property Get ForeColor() As OLE_COLOR
Attribute ForeColor.VB_Description = "返回/设置对象中文本和图形的前景色。"
ForeColor = UserControl.ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
UserControl.ForeColor() = New_ForeColor
PropertyChanged "ForeColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,Enabled
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "返回/设置一个值,决定一个对象是否响应用户生成事件。"
Enabled = UserControl.Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
UserControl.Enabled() = New_Enabled
PropertyChanged "Enabled"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,Font
Public Property Get Font() As Font
Attribute Font.VB_Description = "返回一个 Font 对象。"
Attribute Font.VB_UserMemId = -512
Set Font = UserControl.Font
End Property
Public Property Set Font(ByVal New_Font As Font)
Set UserControl.Font = New_Font
PropertyChanged "Font"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,BackStyle
Public Property Get BackStyle() As Integer
Attribute BackStyle.VB_Description = "指出 Label 或 Shape 的背景样式是透明的还是不透明的。"
BackStyle = UserControl.BackStyle
End Property
Public Property Let BackStyle(ByVal New_BackStyle As Integer)
UserControl.BackStyle() = New_BackStyle
PropertyChanged "BackStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,BorderStyle
Public Property Get BorderStyle() As Integer
Attribute BorderStyle.VB_Description = "返回/设置对象的边框样式。"
BorderStyle = UserControl.BorderStyle
End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As Integer)
UserControl.BorderStyle() = New_BorderStyle
PropertyChanged "BorderStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,Refresh
Public Sub Refresh()
Attribute Refresh.VB_Description = "强制完全重画一个对象。"
UserControl.Refresh
End Sub
Private Sub UserControl_Click()
RaiseEvent Click
End Sub
Private Sub UserControl_DblClick()
RaiseEvent DblClick
End Sub
Private Sub UserControl_Initialize()
Call drawface
End Sub
Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyDown(KeyCode, Shift)
End Sub
Private Sub UserControl_KeyPress(KeyAscii As Integer)
RaiseEvent KeyPress(KeyAscii)
End Sub
Private Sub UserControl_KeyUp(KeyCode As Integer, Shift As Integer)
RaiseEvent KeyUp(KeyCode, Shift)
End Sub
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,AutoRedraw
Public Property Get AutoRedraw() As Boolean
Attribute AutoRedraw.VB_Description = "返回/设置从 graphics 方法到一个持久性位图的输出。"
AutoRedraw = UserControl.AutoRedraw
End Property
Public Property Let AutoRedraw(ByVal New_AutoRedraw As Boolean)
UserControl.AutoRedraw() = New_AutoRedraw
PropertyChanged "AutoRedraw"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,DrawMode
Public Property Get DrawMode() As Integer
Attribute DrawMode.VB_Description = "设置以 graphics 方法或 Shape 、 Line 控件输出时的外观。"
DrawMode = UserControl.DrawMode
End Property
Public Property Let DrawMode(ByVal New_DrawMode As Integer)
UserControl.DrawMode() = New_DrawMode
PropertyChanged "DrawMode"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,DrawStyle
Public Property Get DrawStyle() As Integer
Attribute DrawStyle.VB_Description = "决定 graphics 方法输出时的线条样式。"
DrawStyle = UserControl.DrawStyle
End Property
Public Property Let DrawStyle(ByVal New_DrawStyle As Integer)
UserControl.DrawStyle() = New_DrawStyle
PropertyChanged "DrawStyle"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,FillColor
Public Property Get FillColor() As OLE_COLOR
Attribute FillColor.VB_Description = "返回/设置填充形状、圆环和方框所使用的颜色。"
FillColor = UserControl.FillColor
End Property
Public Property Let FillColor(ByVal New_FillColor As OLE_COLOR)
UserControl.FillColor() = New_FillColor
PropertyChanged "FillColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MappingInfo=UserControl,UserControl,-1,FillStyle
Public Property Get FillStyle() As Integer
Attribute FillStyle.VB_Description = "返回/设置一个 shape 控件的填充样式。"
FillStyle = UserControl.FillStyle
End Property
Public Property Let FillStyle(ByVal New_FillStyle As Integer)
UserControl.FillStyle() = New_FillStyle
PropertyChanged "FillStyle"
End Property
'为用户控件初始化属性
Private Sub UserControl_InitProperties()
Set UserControl.Font = Ambient.Font
Call drawface
m_noden1 = m_def_noden1
m_noden2 = m_def_noden2
m_noden3 = m_def_noden3
m_noden4 = m_def_noden4
m_isnew = m_def_isnew
m_nodestate = m_def_nodestate
End Sub
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
UserControl.BackColor = PropBag.ReadProperty("BackColor", &HFFFFFF)
UserControl.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
UserControl.BackStyle = PropBag.ReadProperty("BackStyle", 1)
UserControl.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
UserControl.AutoRedraw = PropBag.ReadProperty("AutoRedraw", True)
UserControl.DrawMode = PropBag.ReadProperty("DrawMode", 13)
UserControl.DrawStyle = PropBag.ReadProperty("DrawStyle", 0)
UserControl.FillColor = PropBag.ReadProperty("FillColor", &H0&)
UserControl.FillStyle = PropBag.ReadProperty("FillStyle", 1)
m_noden1 = PropBag.ReadProperty("noden1", m_def_noden1)
m_noden2 = PropBag.ReadProperty("noden2", m_def_noden2)
m_noden3 = PropBag.ReadProperty("noden3", m_def_noden3)
m_noden4 = PropBag.ReadProperty("noden4", m_def_noden4)
m_isnew = PropBag.ReadProperty("isnew", m_def_isnew)
m_nodestate = PropBag.ReadProperty("nodestate", m_def_nodestate)
End Sub
'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &HFFFFFF)
Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &H80000012)
Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True)
Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 1)
Call PropBag.WriteProperty("BorderStyle", UserControl.BorderStyle, 0)
Call PropBag.WriteProperty("AutoRedraw", UserControl.AutoRedraw, True)
Call PropBag.WriteProperty("DrawMode", UserControl.DrawMode, 13)
Call PropBag.WriteProperty("DrawStyle", UserControl.DrawStyle, 0)
Call PropBag.WriteProperty("FillColor", UserControl.FillColor, &H0&)
Call PropBag.WriteProperty("FillStyle", UserControl.FillStyle, 1)
Call PropBag.WriteProperty("noden1", m_noden1, m_def_noden1)
Call PropBag.WriteProperty("noden2", m_noden2, m_def_noden2)
Call PropBag.WriteProperty("noden3", m_noden3, m_def_noden3)
Call PropBag.WriteProperty("noden4", m_noden4, m_def_noden4)
Call PropBag.WriteProperty("isnew", m_isnew, m_def_isnew)
Call PropBag.WriteProperty("nodestate", m_nodestate, m_def_nodestate)
End Sub
Sub drawface()
UserControl.Circle (30, 30), 30, vbBlack
End Sub
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get noden1() As Integer
noden1 = m_noden1
End Property
Public Property Let noden1(ByVal New_noden1 As Integer)
m_noden1 = New_noden1
PropertyChanged "noden1"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get noden2() As Integer
noden2 = m_noden2
End Property
Public Property Let noden2(ByVal New_noden2 As Integer)
m_noden2 = New_noden2
PropertyChanged "noden2"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get noden3() As Integer
noden3 = m_noden3
End Property
Public Property Let noden3(ByVal New_noden3 As Integer)
m_noden3 = New_noden3
PropertyChanged "noden3"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get noden4() As Integer
noden4 = m_noden4
End Property
Public Property Let noden4(ByVal New_noden4 As Integer)
m_noden4 = New_noden4
PropertyChanged "noden4"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get isnew() As Integer
isnew = m_isnew
End Property
Public Property Let isnew(ByVal New_isnew As Integer)
m_isnew = New_isnew
PropertyChanged "isnew"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=7,0,0,0
Public Property Get nodestate() As Integer
nodestate = m_nodestate
End Property
Public Property Let nodestate(ByVal New_nodestate As Integer)
m_nodestate = New_nodestate
PropertyChanged "nodestate"
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -