📄 frminformation.frm
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form frmInformation
BorderStyle = 4 'Fixed ToolWindow
Caption = "科目信息"
ClientHeight = 3960
ClientLeft = 45
ClientTop = 315
ClientWidth = 3300
Icon = "frmInformation.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3960
ScaleWidth = 3300
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin ComctlLib.TreeView treAccount
Height = 3810
Left = 60
TabIndex = 0
Top = 75
Width = 3150
_ExtentX = 5556
_ExtentY = 6720
_Version = 327682
Indentation = 53
LineStyle = 1
PathSeparator = ""
Style = 7
ImageList = "ilsImageList"
Appearance = 1
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
Begin ComctlLib.ImageList ilsImageList
Left = 2205
Top = 3255
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 13
ImageHeight = 13
MaskColor = 12632256
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 4
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmInformation.frx":000C
Key = "Close"
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmInformation.frx":0106
Key = "Open"
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmInformation.frx":0200
Key = "Leaf"
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "frmInformation.frx":02FA
Key = "Select"
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmInformation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''
'
'显示科目信息窗体
'
'作者:苏涛
'
'日期:1998-07-03
'
''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private Sub Form_Activate()
SetHelpID Me.HelpContextID
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then Unload Me
End Sub
Private Sub Form_Load()
Dim NodX As Node
Dim recAccount As rdoResultset
Dim strSql As String
' SetHelpID Me.hwnd, 21005
Me.HelpContextID = 21005
Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
frmInformation.Left = frmNewAccount.Left + 3675
frmInformation.top = frmNewAccount.top + 1700
' ilsImageList.ListImages.Add , "Close", GetFormResPicture(101, vbResBitmap)
' ilsImageList.ListImages.Add , "Open", GetFormResPicture(102, vbResBitmap)
strSql = "SELECT Sa.strAccountCode,Sa.strAccountName,AT.strAccountTypeName " _
& " ,Sa.lngAccountTypeID FROM SysAccount AS Sa,AccountType AS AT ,Sa LEFT JOIN AT ON " _
& "Sa.lngAccountTypeID=AT.lngAccountTypeID WHERE Sa.lngTradeID =" _
& frmNewAccount.lstTrade.ItemData(frmNewAccount.lstTrade.ListIndex) _
& " ORDER BY Sa.strAccountCode "
Set recAccount = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
If recAccount.EOF Then
recAccount.Close
Exit Sub
End If
treAccount.Nodes.Clear
With frmNewAccount
Select Case True
Case .OptAccountSystem(0).Value ', .OptAccountSystem(3).Value
treAccount.Nodes.Add , , "r1\", "资产"
treAccount.Nodes.Add , , "r2\", "负债"
treAccount.Nodes.Add , , "r3\", "权益"
treAccount.Nodes.Add , , "r4\", "成本"
treAccount.Nodes.Add , , "r5\", "损益"
Case .OptAccountSystem(1).Value, .OptAccountSystem(2).Value
treAccount.Nodes.Add , , "r1\", "资产"
treAccount.Nodes.Add , , "r2\", "负债"
treAccount.Nodes.Add , , "r3\", "净资产"
treAccount.Nodes.Add , , "r4\", "收入"
treAccount.Nodes.Add , , "r5\", "支出"
Case .OptAccountSystem(3).Value
treAccount.Nodes.Add , , "r1\", "资产"
treAccount.Nodes.Add , , "r2\", "负债"
treAccount.Nodes.Add , , "r3\", "净资产"
treAccount.Nodes.Add , , "r4\", "收支"
End Select
End With
Dim strInsnode As String
Dim strLastText As String
Dim intPos As Integer
With recAccount
Do Until .EOF
strInsnode = !strAccountCode
strLastText = OverChang(strInsnode)
intPos = InStr(strLastText, "-")
If intPos <> 0 Then
strLastText = OverChang(Mid(strLastText, intPos + 1))
Select Case !lngAccountTypeID
Case 1
treAccount.Nodes.Add "r1\" & strLastText, tvwChild, "r1\" _
& strInsnode, strInsnode & " " & !strAccountName
Case 2
treAccount.Nodes.Add "r2\" & strLastText, tvwChild, "r2\" _
& strInsnode, strInsnode & " " & !strAccountName
Case 3
treAccount.Nodes.Add "r3\" & strLastText, tvwChild, "r3\" _
& strInsnode, strInsnode & " " & !strAccountName
Case 4
treAccount.Nodes.Add "r4\" & strLastText, tvwChild, "r4\" _
& strInsnode, strInsnode & " " & !strAccountName
Case 5
treAccount.Nodes.Add "r5\" & strLastText, tvwChild, "r5\" _
& strInsnode, strInsnode & " " & !strAccountName
End Select
Else
Select Case !lngAccountTypeID
Case 1
treAccount.Nodes.Add "r1\", tvwChild, "r1\" & strInsnode, strInsnode & " " & !strAccountName
Case 2
treAccount.Nodes.Add "r2\", tvwChild, "r2\" & strInsnode, strInsnode & " " & !strAccountName
Case 3
treAccount.Nodes.Add "r3\", tvwChild, "r3\" & strInsnode, strInsnode & " " & !strAccountName
Case 4
treAccount.Nodes.Add "r4\", tvwChild, "r4\" & strInsnode, strInsnode & " " & !strAccountName
Case 5
treAccount.Nodes.Add "r5\", tvwChild, "r5\" & strInsnode, strInsnode & " " & !strAccountName
End Select
End If
recAccount.MoveNext
Loop
End With
recAccount.Close
For Each NodX In treAccount.Nodes
If NodX.Children > 0 Then
NodX.iMage = "Close"
NodX.SelectedImage = "Open"
NodX.Expanded = True
Else
NodX.iMage = "Leaf"
NodX.SelectedImage = "Select"
End If
Next NodX
If Not treAccount.Nodes(1) Is Nothing Then treAccount.Nodes(1).Expanded = True
End Sub
Public Function OverChang(strCode As String)
Dim i As Integer
For i = Len(strCode) To 1 Step -1
OverChang = OverChang & Mid(strCode, i, 1)
Next
End Function
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
Utility.RemoveFormResPicture (139)
End Sub
Private Sub treAccount_Collapse(ByVal Node As ComctlLib.Node)
Node.Selected = False
End Sub
Private Sub treAccount_Expand(ByVal Node As ComctlLib.Node)
Node.Selected = True
'Node.Expanded = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -