📄 formsubobject.frm
字号:
VERSION 5.00
Begin VB.Form FormSubObject
Caption = "添加子对象"
ClientHeight = 4515
ClientLeft = 60
ClientTop = 345
ClientWidth = 5790
LinkTopic = "Form3"
MaxButton = 0 'False
ScaleHeight = 4515
ScaleWidth = 5790
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtNodeContent
BackColor = &H00C0E0FF&
Height = 645
Left = 1575
MultiLine = -1 'True
TabIndex = 4
Top = 3045
Width = 3690
End
Begin VB.ListBox lstFatherObject
BackColor = &H00C0E0FF&
Height = 2010
ItemData = "FormSubObject.frx":0000
Left = 1575
List = "FormSubObject.frx":0002
TabIndex = 3
Top = 540
Width = 3375
End
Begin VB.TextBox txtChildObject
BackColor = &H00C0E0FF&
Height = 285
Left = 1575
TabIndex = 2
Top = 120
Width = 3375
End
Begin VB.CommandButton CancelButton
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 3990
TabIndex = 1
Top = 3990
Width = 1215
End
Begin VB.CommandButton OKButton
Caption = "OK"
Default = -1 'True
Height = 375
Left = 1575
TabIndex = 0
Top = 3990
Width = 1215
End
Begin VB.Label lblNodeContent
AutoSize = -1 'True
Caption = "Content"
Height = 195
Left = 735
TabIndex = 7
Top = 3045
Width = 555
End
Begin VB.Label lblNodeType
AutoSize = -1 'True
Caption = "父对象"
Height = 195
Left = 600
TabIndex = 6
Top = 540
Width = 540
End
Begin VB.Label SubObject
AutoSize = -1 'True
Caption = "子对象"
Height = 195
Left = 600
TabIndex = 5
Top = 120
Width = 540
End
End
Attribute VB_Name = "FormSubObject"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CancelButton_Click()
Unload Me
End Sub
Function AddChildObject(ByRef Index As Integer)
Dim df As CDomFunctions
Dim oDom As IXMLDOMNode
Set oDom = oDoc.documentElement
Set df = New CDomFunctions
df.AddElement oDoc, oDom.childNodes(Index), txtChildObject.Text, ""
FrmTreeView.TreeView
End Function
Private Sub Form_Load()
Dim oDom As IXMLDOMNode
Dim i As Integer
Dim j As Integer
Set oDom = oDoc.documentElement
For i = 0 To oDom.childNodes.length - 1
For j = 0 To oDom.childNodes(i).Attributes.length - 1
If oDom.childNodes(i).Attributes(j).nodeName = "name" Then
lstFatherObject.AddItem oDom.childNodes(i).Attributes(j).nodeValue, i
End If
Next
Next
End Sub
Private Sub OKButton_Click()
If (lstFatherObject.ListIndex < 0) Then
MsgBox "未选择父对象"
End If
If (Not lstFatherObject.ListIndex < 0 And Not txtChildObject = "") Then
AddChildObject (lstFatherObject.ListIndex)
MsgBox "添加对象" & txtChildObject, , "信息"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -