?? fjcx.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 + -