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

📄 fjcx.frm

📁 酒店系统源码。为了学习和 研究软件内含的设计思想和原理
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FJCX 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "房间查询"
   ClientHeight    =   3540
   ClientLeft      =   690
   ClientTop       =   1740
   ClientWidth     =   6210
   Icon            =   "FJCX.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3540
   ScaleWidth      =   6210
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Default         =   -1  'True
      Height          =   375
      Left            =   4920
      TabIndex        =   2
      Top             =   720
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确认"
      Height          =   375
      Left            =   4920
      TabIndex        =   1
      Top             =   240
      Width           =   1095
   End
   Begin MSComctlLib.TreeView TreeView1 
      Height          =   3225
      Left            =   120
      TabIndex        =   0
      Top             =   140
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   5689
      _Version        =   393217
      LabelEdit       =   1
      LineStyle       =   1
      Style           =   7
      FullRowSelect   =   -1  'True
      SingleSel       =   -1  'True
      ImageList       =   "ImageList1"
      Appearance      =   1
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   5040
      Top             =   1440
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   17
      ImageHeight     =   15
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FJCX.frx":0442
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FJCX.frx":07A2
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FJCX.frx":0B3E
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "FJCX.frx":0EF2
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "FJCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DATJDGL As Database
Dim RECFJ As Recordset
Public INTFH As Integer
Private Sub Command1_Click()
    On Error GoTo YJERROR
    If left(TreeView1.SelectedItem.Key, 1) <> "B" Then
       TreeView1.SetFocus
       Exit Sub
       Else
         INTFH = RECFJ("房号")
    End If
    Unload Me
    Exit Sub
    
YJERROR:
    MsgBox CStr(Err.Number) & "-" & Err.Description, vbCritical, "错误信息"
    Resume Next
    
End Sub

Private Sub Command2_Click()
    INTFH = 0
    Unload Me
    
End Sub

Private Sub Form_Activate()
    Dim TEMPNODE As Node
    
    Set RECFJ = DATJDGL.OpenRecordset("房间状态", dbOpenDynaset)
    If RECFJ.RecordCount = 0 Then
       MsgBox "系统无房间信息可查!", vbInformation, "提示信息"
       Unload Me
       Exit Sub
    End If
    TreeView1.Nodes.Clear
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A一楼", "一楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A二楼", "二楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A三楼", "三楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A四楼", "四楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A五楼", "五楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A六楼", "六楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A七楼", "七楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A八楼", "八楼", 1, 2)
    Set TEMPNODE = TreeView1.Nodes.Add(, , "A未知楼层", "未知楼层", 1, 2)
    While Not RECFJ.EOF
        If IsNull(RECFJ("楼层")) Then
           STRKEY = "A未知楼层"
           Else
             STRKEY = "A" + RECFJ("楼层")
        End If
        STRTEXT = ""
        If IsNull(RECFJ("房号")) Then
           STRTEXT = "未知房号"
           Else
             STRTEXT = CStr(RECFJ("房号"))
        End If
        If IsNull(RECFJ("类型")) Then
           STRTEXT = STRTEXT + "  " + "未知类型"
           Else
             STRTEXT = STRTEXT + "  " + RECFJ("类型")
        End If
        If IsNull(RECFJ("房态")) Then
           STRTEXT = STRTEXT + "  " + "未知房态"
           Else
             STRTEXT = STRTEXT + "  " + RECFJ("房态")
        End If
        Set TEMPNODE = TreeView1.Nodes.Add(STRKEY, tvwChild, "B" & Str(RECFJ("ID")), STRTEXT, 3, 4)
        RECFJ.MoveNext
    Wend
    If RECFJ.RecordCount > 0 Then RECFJ.MoveFirst
    Set TEMPNODE = TreeView1.Nodes("B" & Str(RECFJ("ID")))
    TEMPNODE.EnsureVisible
    TEMPNODE.Selected = True
    TreeView1.SetFocus
End Sub

Private Sub Form_Load()
    Set DATJDGL = OpenDatabase(App.Path & "\DATA\JDGL.MDB")
End Sub

Private Sub Form_Unload(Cancel As Integer)
    DATJDGL.Close
End Sub

Private Sub TreeView1_DblClick()
    Command1_Click
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    If left(TreeView1.SelectedItem.Key, 1) = "B" Then
       RECFJ.FindFirst ("ID=" & MID(TreeView1.SelectedItem.Key, 2))
    End If
End Sub
Private Sub TreeView1_Collapse(ByVal Node As MSComctlLib.Node)
    Node.Image = 1
End Sub

Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
    Node.Image = 2
End Sub

⌨️ 快捷键说明

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