www.pudn.com > TreeView 中节点拖动、增加、删除等功能演示.zip > bldtree.frm


VERSION 5.00 
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX" 
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX" 
Begin VB.Form Form1  
   Caption         =   "Form1" 
   ClientHeight    =   6465 
   ClientLeft      =   2475 
   ClientTop       =   1710 
   ClientWidth     =   8145 
   LinkTopic       =   "Form1" 
   PaletteMode     =   1  'UseZOrder 
   ScaleHeight     =   6465 
   ScaleWidth      =   8145 
   Begin VB.Frame Frame2  
      Height          =   2175 
      Left            =   5280 
      TabIndex        =   8 
      Top             =   3600 
      Width           =   2535 
      Begin VB.CommandButton cmdLoad  
         Caption         =   "Load from Table" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   11 
         Top             =   1560 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdSave  
         Caption         =   "Save to Table" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   10 
         Top             =   960 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdClear  
         Caption         =   "Clear Treeview" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   9 
         Top             =   360 
         Width           =   2055 
      End 
   End 
   Begin VB.CommandButton cmdClose  
      Caption         =   "Close" 
      Height          =   375 
      Left            =   5520 
      TabIndex        =   2 
      Top             =   6000 
      Width           =   2055 
   End 
   Begin VB.Frame Frame1  
      Height          =   3375 
      Left            =   5280 
      TabIndex        =   1 
      Top             =   120 
      Width           =   2535 
      Begin VB.CommandButton cmdRemove  
         Caption         =   "Remove Node" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   12 
         Top             =   2760 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdChild  
         Caption         =   "Add Child" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   7 
         Top             =   2280 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdPrevious  
         Caption         =   "Add Previous Sibling" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   6 
         Top             =   1800 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdNext  
         Caption         =   "Add Next Sibling" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   5 
         Top             =   1320 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdLast  
         Caption         =   "Add Last Sibling" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   4 
         Top             =   840 
         Width           =   2055 
      End 
      Begin VB.CommandButton cmdFirst  
         Caption         =   "Add First Sibling" 
         Height          =   375 
         Left            =   240 
         TabIndex        =   3 
         Top             =   360 
         Width           =   2055 
      End 
   End 
   Begin MSComDlg.CommonDialog CommonDialog1  
      Left            =   4320 
      Top             =   4680 
      _ExtentX        =   847 
      _ExtentY        =   847 
      _Version        =   327680 
   End 
   Begin ComctlLib.TreeView TreeView1  
      Height          =   5535 
      Left            =   240 
      TabIndex        =   0 
      Top             =   360 
      Width           =   3855 
      _ExtentX        =   6800 
      _ExtentY        =   9763 
      _Version        =   327680 
      Style           =   7 
      ImageList       =   "ImageList1" 
      BorderStyle     =   1 
      Appearance      =   1 
      MouseIcon       =   "bldtree.frx":0000 
   End 
   Begin ComctlLib.ImageList ImageList1  
      Left            =   4320 
      Top             =   5400 
      _ExtentX        =   1005 
      _ExtentY        =   1005 
      BackColor       =   -2147483643 
      ImageWidth      =   16 
      ImageHeight     =   16 
      MaskColor       =   12632256 
      _Version        =   327680 
      BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}  
         NumListImages   =   2 
         BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}  
            Picture         =   "bldtree.frx":001C 
            Key             =   "" 
         EndProperty 
         BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}  
            Picture         =   "bldtree.frx":0336 
            Key             =   "" 
         EndProperty 
      EndProperty 
   End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
'This example shows how to save and restore the nodes of a TreeView Control 
'to an Access database. It will let you add nodes to the TreeView 
'using the five different relationships of the Add Method (Nodes Collection). 
'The numbering of the Nodes is seqental. So every time you add a Node the Node number 
'is increameted. The text shows what button was used to add a Node. So you can read the 
'Node text as follows: