📄 项目定义窗体.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{5AD81966-3173-4597-A32E-4F4620DA3B57}#3.4#0"; "U8TBCtl.ocx"
Begin VB.Form frmPrjDef
BorderStyle = 1 'Fixed Single
Caption = "项目定义"
ClientHeight = 6435
ClientLeft = 2880
ClientTop = 1845
ClientWidth = 7305
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 6435
ScaleWidth = 7305
Begin prjTBCtrl.CTBCtrl ocxCtbTool
Height = 660
Left = 2160
Top = 1800
Width = 735
_ExtentX = 1296
_ExtentY = 1164
End
Begin MSComctlLib.ImageList IltTree
Left = 1680
Top = 3120
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
MaskColor = 12632256
_Version = 393216
End
Begin MSComctlLib.ImageList IltTool
Left = 1200
Top = 3840
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
MaskColor = 12632256
_Version = 393216
End
Begin VB.TextBox txtMemo
Height = 1215
Left = 4200
MultiLine = -1 'True
TabIndex = 4
Top = 5040
Width = 2775
End
Begin VB.ComboBox cboPrjClass
Height = 300
ItemData = "项目定义窗体.frx":0000
Left = 4200
List = "项目定义窗体.frx":000A
Style = 2 'Dropdown List
TabIndex = 0
ToolTipText = "选择项目类型!"
Top = 2880
Width = 2775
End
Begin VB.TextBox txtPrjName
Height = 735
Left = 4200
MultiLine = -1 'True
TabIndex = 3
ToolTipText = "项目名称不能为空!"
Top = 4080
Width = 2775
End
Begin VB.TextBox txtPrjCode
Height = 375
Left = 4200
TabIndex = 1
Top = 3480
Width = 2760
End
Begin MSComctlLib.TreeView treNode
Height = 5595
Left = 60
TabIndex = 5
Top = 660
Width = 3015
_ExtentX = 5318
_ExtentY = 9869
_Version = 393217
Indentation = 882
LineStyle = 1
Sorted = -1 'True
Style = 7
HotTracking = -1 'True
SingleSel = -1 'True
Appearance = 1
End
Begin MSComctlLib.Toolbar tlbTool
Align = 1 'Align Top
Height = 540
Left = 0
TabIndex = 2
Top = 0
Width = 7305
_ExtentX = 12885
_ExtentY = 953
ButtonWidth = 820
ButtonHeight = 953
Wrappable = 0 'False
Style = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 14
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Caption = "增加"
Key = "ADDNEW"
Object.ToolTipText = "增加一级项目"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Caption = "增子"
Key = "ADDCHILD"
Object.ToolTipText = "增加二级项目"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "增加"
Key = "add"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "edit"
Object.ToolTipText = "编辑项目"
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "delete"
Object.ToolTipText = "删除项目"
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "保存"
Key = "save"
Object.ToolTipText = "保存项目"
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "放弃"
Key = "cancel"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "a"
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刷新"
Key = "refresh"
Object.ToolTipText = "刷新"
EndProperty
BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "s"
Style = 3
EndProperty
BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
Enabled = 0 'False
Caption = "附表"
Key = "append"
EndProperty
BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "帮助"
Key = "help"
Object.ToolTipText = "帮助"
EndProperty
BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "quit"
Object.ToolTipText = "退出"
EndProperty
EndProperty
End
Begin VB.Label lbUsed
Caption = "已使用"
ForeColor = &H000000FF&
Height = 255
Left = 6360
TabIndex = 15
Top = 960
Visible = 0 'False
Width = 615
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "项目说明:"
Height = 660
Left = 3240
TabIndex = 14
Top = 5040
Width = 810
End
Begin VB.Label Label4
Caption = "上级编号:"
Height = 255
Left = 0
TabIndex = 11
Top = 0
Width = 1455
End
Begin VB.Label lbParentName
Height = 975
Left = 4200
TabIndex = 13
Top = 1440
Width = 3015
WordWrap = -1 'True
End
Begin VB.Label lbParentCode
Height = 255
Left = 4200
TabIndex = 12
Top = 960
Width = 1815
End
Begin VB.Label Label5
Caption = "项目类别:"
Height = 375
Left = 3240
TabIndex = 10
Top = 2880
Width = 855
End
Begin VB.Label d
Caption = "上级名称:"
Height = 255
Left = 3240
TabIndex = 9
Top = 1440
Width = 1455
End
Begin VB.Label s
Caption = "上级编号:"
Height = 255
Left = 3240
TabIndex = 8
Top = 960
Width = 1455
End
Begin VB.Line Line1
BorderColor = &H80000011&
BorderWidth = 3
X1 = 3240
X2 = 7260
Y1 = 2640
Y2 = 2640
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "项目名称:"
Height = 195
Left = 3240
TabIndex = 7
Top = 4200
Width = 765
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "项目编码:"
Height = 195
Left = 3240
TabIndex = 6
Top = 3600
Width = 765
End
End
Attribute VB_Name = "frmPrjDef"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'作者: 孙志远
'功能: 设置资金使用计划的项目信息
'原理: 项目信息对象-保存数据库中提取的项目记录信息
' 项目信息对象向量-考虑到项目定义的规模较小,
' 将项目信息对象缓存在内存中,
' 而不是每次提取数据库,加快信息
Option Explicit
Private m_objPrjInfo As New Collection '保存项目信息的向量
Private m_iSavFlag As Integer '修改标志 1代表增加,2代表编辑
Private m_objTmp As U8BudgetMgr.clsPrjData '保存临时的项目信息对象
Private m_sCurUpdate As String '当前项目对象关键字
'选择项目种类
Private Sub cboPrjClass_Click()
If m_iSavFlag <> 0 Then
m_objTmp.PrjClass = cboPrjClass.ListIndex
End If
End Sub
'处理快捷键
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
bShortCut KeyCode, Shift
End Sub
Private Sub Form_Load()
'设置菜单按钮
LoadToolPic
'初始化状态
InitState
loadPrjTree
SetTBStyle Me
End Sub
Private Sub Form_Resize()
ResizeTlb Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If iCheck = vbCancel Then
Cancel = 1
Exit Sub
End If
Finalize
Unload Me
End Sub
Private Sub ocxCtbTool_OnCommand(ByVal enumType As prjTBCtrl.ENUM_MENU_OR_BUTTON, ByVal cButtonId As String, ByVal cMenuId As String)
tlbTool_ButtonClick tlbTool.Buttons(cButtonId)
End Sub
'菜单操作
Private Sub tlbTool_ButtonClick(ByVal Button As MsComctlLib.Button)
Select Case Button.key
Case "quit" '退出
Quit
Case "help" '帮助
SendKeys "{F1}"
Case "save" '保存
SaveData
Case "refresh" '刷新"
Reload
Case "cancel" '取消
Cancel
Case "delete" '删除节点
DeleteData
Case "edit" '设置修改状态
SetChange
' Case "ADDCHILD" '增加子项目
' AddData True
' Case "ADDNEW" '增加父项目
' AddData
Case "append" '添加附表信息
AddOn
Case "add" '增加
AddNew
Case Else
'ishowmsg "没有该功能定义"
End Select
If Button.key <> "quit" Then
ocxCtbTool.RefreshEnable
End If
End Sub
Private Sub treNode_Collapse(ByVal Node As MsComctlLib.Node)
treNode_NodeClick Node
End Sub
Private Sub treNode_Expand(ByVal Node As MsComctlLib.Node)
treNode_NodeClick Node
End Sub
'单击树状视图,显示对应的项目信息
Private Sub treNode_NodeClick(ByVal Node As MsComctlLib.Node)
Dim tmp As String
Dim str As clsPrjData
On Error Resume Next
'是否正在进行操作
If iCheck = vbCancel Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -