资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:4k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form Hp_Dept_Frm
- AutoRedraw = -1 'True
- BorderStyle = 3 'Fixed Dialog
- Caption = "部门选择"
- ClientHeight = 5100
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 2880
- ControlBox = 0 'False
- Icon = "帮助_部门帮助.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5100
- ScaleWidth = 2880
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 '所有者中心
- Begin VB.CommandButton Cmd_Cancel
- Cancel = -1 'True
- Caption = "取消(&C)"
- Height = 300
- Left = 1695
- TabIndex = 4
- Top = 4740
- Width = 1120
- End
- Begin VB.CommandButton Cmd_OK
- Caption = "确定(&O)"
- Default = -1 'True
- Height = 300
- Left = 510
- TabIndex = 3
- Top = 4740
- Width = 1120
- End
- Begin MSComctlLib.TreeView TV_Dept
- Height = 4140
- Left = 75
- TabIndex = 2
- Top = 540
- Width = 2730
- _ExtentX = 4815
- _ExtentY = 7303
- _Version = 393217
- HideSelection = 0 'False
- Style = 7
- Appearance = 1
- End
- Begin VB.TextBox Txt_Dept
- Height = 315
- Left = 525
- TabIndex = 1
- Top = 120
- Width = 2295
- End
- Begin VB.Label Lab_Mark
- AutoSize = -1 'True
- Caption = "部门:"
- Height = 180
- Index = 3
- Left = 60
- TabIndex = 0
- Top = 195
- Width = 450
- End
- End
- Attribute VB_Name = "Hp_Dept_Frm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Public bMinLvl As Boolean
- Public sDept As String
- Private Sub Cmd_Cancel_Click()
- sDept = ""
- Unload Me
- End Sub
- Private Sub Cmd_OK_Click()
- With Me.TV_Dept
- If Not .SelectedItem Is Nothing Then
- If Me.bMinLvl = True Then
- If .SelectedItem.Children <> 0 Then
- MsgBox "请选择末级部门!", vbOKOnly + vbCritical
- Exit Sub
- Else
- sDept = .SelectedItem.Tag
- End If
- End If
- Else
- sDept = ""
- End If
- End With
- Unload Me
- End Sub
- Private Sub Form_Load()
- On Error GoTo ErrCtrl
- '初始化部门树
- FillDept2TV "RsPmFlag", Me.TV_Dept, Cw_DataEnvi.DataConnect
- Exit Sub
- ErrCtrl:
- Unload Me
- End Sub
- Private Sub TV_Dept_BeforeLabelEdit(Cancel As Integer)
- Cancel = 1
- End Sub
- Private Sub TV_Dept_NodeCheck(ByVal node As MSComctlLib.node)
- Dim i As Integer
- With Me.TV_Dept
- For i = 1 To .Nodes.count
- If .Nodes(i).Parent Is node Then
- .Nodes(i).Checked = node.Checked
- Call TV_Dept_NodeCheck(.Nodes(i))
- End If
- Next i
- End With
- End Sub
- Private Sub Txt_Dept_Change()
- Dim i As Integer
- Dim s As String
- s = Trim(Me.Txt_Dept.Text)
- With Me.TV_Dept
- For i = 1 To .Nodes.count
- If .Nodes(i).Tag = s Then
- .Nodes(i).EnsureVisible
- .SelectedItem = .Nodes(i)
- Exit Sub
- End If
- Next i
- End With
- End Sub