📄 frmphygin.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmPHygin
Caption = "员工情况输入"
ClientHeight = 5265
ClientLeft = 60
ClientTop = 345
ClientWidth = 7395
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 5265
ScaleWidth = 7395
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
Height = 4395
Left = 30
TabIndex = 1
Top = 720
Width = 7275
Begin MSComctlLib.TreeView TreeView1
Height = 4125
Left = 90
TabIndex = 2
Top = 180
Width = 2055
_ExtentX = 3625
_ExtentY = 7276
_Version = 393217
PathSeparator = ""
Style = 7
Appearance = 1
End
Begin MSComctlLib.ListView ListView1
Height = 4185
Left = 2160
TabIndex = 10
Top = 150
Width = 5085
_ExtentX = 8969
_ExtentY = 7382
LabelWrap = -1 'True
HideSelection = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Begin VB.Frame Frame1
Height = 735
Left = 30
TabIndex = 0
Top = -30
Width = 7275
Begin VB.PictureBox Picture7
BorderStyle = 0 'None
Height = 465
Left = 180
Picture = "frmPHygin.frx":0000
ScaleHeight = 465
ScaleWidth = 165
TabIndex = 9
Top = 180
Width = 165
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 555
Left = 660
Picture = "frmPHygin.frx":0222
ScaleHeight = 555
ScaleWidth = 525
TabIndex = 8
Top = 120
Width = 525
End
Begin VB.PictureBox Picture2
BorderStyle = 0 'None
Height = 555
Left = 1434
Picture = "frmPHygin.frx":05C4
ScaleHeight = 555
ScaleWidth = 525
TabIndex = 7
Top = 120
Width = 525
End
Begin VB.PictureBox Picture3
BorderStyle = 0 'None
Height = 555
Left = 2298
Picture = "frmPHygin.frx":0966
ScaleHeight = 555
ScaleWidth = 525
TabIndex = 6
Top = 120
Width = 525
End
Begin VB.PictureBox Picture4
BorderStyle = 0 'None
Height = 555
Left = 3162
Picture = "frmPHygin.frx":0D08
ScaleHeight = 555
ScaleWidth = 585
TabIndex = 5
Top = 120
Width = 585
End
Begin VB.PictureBox Picture5
BorderStyle = 0 'None
Height = 555
Left = 4086
Picture = "frmPHygin.frx":200A
ScaleHeight = 555
ScaleWidth = 585
TabIndex = 4
Top = 120
Width = 585
End
Begin VB.PictureBox Picture6
BorderStyle = 0 'None
Height = 555
Left = 5010
Picture = "frmPHygin.frx":330C
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 3
Top = 120
Width = 555
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 14
ImageHeight = 17
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPHygin.frx":460E
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPHygin.frx":4952
Key = ""
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmPHygin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim jframe As New dframe
Dim env As rdoEnvironment
Dim cn As rdoConnection
Dim result As rdoResultset
Dim result1 As rdoResultset
Dim d_conn, sql As String
Dim hrowcount, hrowcount1 As Integer
Private Sub Form_Load()
Move Screen.width / 2 - frmPHygin.width / 2, Screen.height / 2 - frmPHygin.height / 2
Set env = rdoEnvironments(0)
env.CursorDriver = rdUseOdbc
d_conn = "uid=sa;pwd=;driver={SQL SERVER};SERVER=ntserver;database=phdatabase;"
Set cn = env.OpenConnection(dsname:="odbc_api_demo", Prompt:="rdodriverprompt", ReadOnly:=False, Connect:=d_conn)
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
ListView1.FullRowSelect = True
ListView1.HotTracking = True
ListView1.View = lvwReport
'ListView1.ColumnHeaders.Add , , " "
Set clm = ListView1.ColumnHeaders.Add(, , "姓名", ListView1.width / 3)
Set clm = ListView1.ColumnHeaders.Add(, , "编号", ListView1.width / 3)
Set clm = ListView1.ColumnHeaders.Add(, , "类别", ListView1.width / 3)
''''''''''
Set TreeView1.ImageList = ImageList1
Set Tree = TreeView1.Nodes.Add(, , "ffff", "类别", 1)
sql = "select distinct 类别 from worktable" ' where 级别='部门'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
i = 1
If result.RowCount <> 0 Then
Do While Not result.EOF()
Set TreeView1.ImageList = ImageList1
Set TreeSub1 = TreeView1.Nodes.Add(Tree, tvwChild, "ffff" & Str(i), result("类别"))
TreeSub1.Image = 1
TreeSub1.EnsureVisible
result.MoveNext
i = i + 1
Loop
End If
End Sub
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture3.Cls
Picture4.Cls
Picture5.Cls
Picture6.Cls
Picture1.Cls
End Sub
Private Sub ListView1_Click()
listviewtext(0) = ListView1.SelectedItem.Text
listviewtext(1) = ListView1.SelectedItem.ListSubItems(1).Text
listviewtext(2) = ListView1.SelectedItem.ListSubItems(2).Text
End Sub
Private Sub ListView1_DblClick()
' listviewtext(0) = ListView1.SelectedItem.Text
' listviewtext(1) = ListView1.SelectedItem.ListSubItems(1).Text
' listviewtext(2) = ListView1.SelectedItem.ListSubItems(2).Text
End Sub
Private Sub Picture1_Click()
jframe.danum = 2
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture1
FlagH = 1
frmPHry.Show 1
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture3.Cls
Picture4.Cls
Picture5.Cls
Picture6.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture1
End Sub
Private Sub Picture2_Click()
FlagH = 2
jframe.danum = 2
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture2
'''''''
listviewtext(0) = ListView1.SelectedItem.Text
listviewtext(1) = ListView1.SelectedItem.ListSubItems(1).Text
listviewtext(2) = ListView1.SelectedItem.ListSubItems(2).Text
frmPHry.Show 1
End Sub
Private Sub Picture2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Cls
Picture3.Cls
Picture4.Cls
Picture5.Cls
Picture6.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture2
End Sub
Private Sub Picture3_Click()
jframe.danum = 2
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture3
''''''''
If MsgBox("确定是否删除?", 36, "删除!") = 6 Then
sql = "delete from worktable where 类别='" & Trim(listviewtext(2)) & "' and 姓名='" & Trim(listviewtext(0)) & "' and 编号='" & Trim(listviewtext(1)) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
End If
End Sub
Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture1.Cls
Picture4.Cls
Picture5.Cls
Picture6.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture3
End Sub
Private Sub Picture4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture3.Cls
Picture1.Cls
Picture5.Cls
Picture6.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture4
End Sub
Private Sub Picture5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture3.Cls
Picture4.Cls
Picture1.Cls
Picture6.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture5
End Sub
Private Sub Picture6_Click()
Unload Me
End Sub
Private Sub Picture6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture2.Cls
Picture3.Cls
Picture4.Cls
Picture5.Cls
Picture1.Cls
jframe.danum = 5
jframe.rtop = 1
jframe.rleft = 1
jframe.rright = 35
jframe.rbottom = 36
jframe.ddrawc Picture6
End Sub
Private Sub TreeView1_DblClick()
' '''''重新刷新
' sql = "select distinct 类别 from worktable" ' where 级别='部门'"
' Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
' i = 1
' If result.RowCount <> 0 Then
' Do While Not result.EOF()
' Set TreeView1.ImageList = ImageList1
' Set TreeSub1 = TreeView1.Nodes.Add(Tree, tvwChild, "ffff" & Str(i), result("类别"))
' TreeSub1.Image = 1
' TreeSub1.EnsureVisible
' result.MoveNext
' i = i + 1
' Loop
' End If
'''''''
sql = "select * from worktable where 类别='" & Trim(GoodsTree) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
ListView1.ListItems.Clear
If result.RowCount <> 0 Then
Do While Not result.EOF()
Set itm = frmPHygin.ListView1.ListItems.Add(, , result("姓名"))
itm.SubItems(1) = Trim(result("编号"))
itm.SubItems(2) = Trim(result("类别"))
result.MoveNext
Loop
End If
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
GoodsTree = Node.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -