⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmbooktypesel.frm

📁 vb与access数据库的操作实例
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form FrmBookTypeSel 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   4230
   ClientLeft      =   15
   ClientTop       =   15
   ClientWidth     =   4215
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4230
   ScaleWidth      =   4215
   Begin VB.CommandButton Cmd_Cancel 
      BackColor       =   &H80000004&
      Caption         =   "取 消"
      Height          =   400
      Left            =   2280
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3600
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_OK 
      BackColor       =   &H80000004&
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   400
      Left            =   360
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3600
      Width           =   1300
   End
   Begin MSComctlLib.ImageList ImageList3 
      Left            =   0
      Top             =   3000
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483628
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   16777215
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   5
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmBookTypeSel.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmBookTypeSel.frx":2992
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmBookTypeSel.frx":5324
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmBookTypeSel.frx":7CB6
            Key             =   ""
         EndProperty
         BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FrmBookTypeSel.frx":A648
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin MSComctlLib.TreeView TreeView1 
      Height          =   3255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   3855
      _ExtentX        =   6800
      _ExtentY        =   5741
      _Version        =   393217
      HideSelection   =   0   'False
      LabelEdit       =   1
      Sorted          =   -1  'True
      Style           =   7
      HotTracking     =   -1  'True
      SingleSel       =   -1  'True
      ImageList       =   "ImageList3"
      BorderStyle     =   1
      Appearance      =   1
      MousePointer    =   99
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "FrmBookTypeSel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Cmd_Cancel_Click()
  Unload Me
End Sub

Private Sub Cmd_OK_Click()
  '如果没有选择图书,则提示重新选择
  If MyBookType.TypeId <= 0 Then
    MsgBox "请选择图书分类"
    Exit Sub
  End If
  '将选择图书的数据保存在CurBookType对象中
  CurBookType.TypeId = MyBookType.TypeId
  CurBookType.GetInfo (CurBookType.TypeId)
  '关闭窗体
  Unload Me
End Sub

Private Sub Form_Load()
  Dim TmpNode As Node
  '设置根结点
  Set TmpNode = TreeView1.Nodes.Add(, , "a0", "图书分类信息", 1, 3)
  TmpNode.Selected = True
  TmpNode.ExpandedImage = 2
  '调用函数将所有图书分类添加到TreeView1中
  Call AddtoTree(TreeView1, "a0")
  TreeView1_Click
End Sub

Private Sub TreeView1_Click()
  Dim Focuskey As String
  '根据关键字获取图书分类信息
  Focuskey = TreeView1.SelectedItem.Key
  MyBookType.TypeName = TreeView1.SelectedItem.Text
  MyBookType.TypeId = Val(Right(TreeView1.SelectedItem.Key, Len(TreeView1.SelectedItem.Key) - 1))
  
  If Focuskey = "a0" Then '根结点
    Exit Sub
  End If
  '如果包含子结点,则设置图像格式
  If MyBookType.HaveSon(MyBookType.TypeId) = False Then
    TreeView1.SelectedItem.ExpandedImage = 4
    TreeView1.SelectedItem.Image = 4
    TreeView1.SelectedItem.SelectedImage = 5
  End If
  '读取MyBookType中的所有图书分类信息
  MyBookType.GetInfo (MyBookType.TypeId)
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -