📄 frmshowgrid.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form FrmShowGrid
Caption = "员工信息查询"
ClientHeight = 8310
ClientLeft = 165
ClientTop = 450
ClientWidth = 11880
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 8310
ScaleWidth = 11880
WindowState = 2 'Maximized
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 600
Top = 7200
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=personnel"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "personnel"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "info"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 495
Left = 6600
TabIndex = 2
Top = 7080
Width = 1935
End
Begin VB.CommandButton cmdDelete
Caption = "删除当前员工"
Height = 495
Left = 2400
TabIndex = 1
Top = 7080
Width = 1935
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid1
Bindings = "frmshowgrid.frx":0000
Height = 6375
Left = 360
TabIndex = 0
Top = 360
Width = 11160
_ExtentX = 19685
_ExtentY = 11245
_Version = 393216
Cols = 13
_NumberOfBands = 1
_Band(0).Cols = 13
_Band(0)._NumMapCols= 12
_Band(0)._MapCol(0)._Name= "姓名"
_Band(0)._MapCol(0)._RSIndex= 0
_Band(0)._MapCol(1)._Name= "部门"
_Band(0)._MapCol(1)._RSIndex= 1
_Band(0)._MapCol(2)._Name= "编号"
_Band(0)._MapCol(2)._RSIndex= 2
_Band(0)._MapCol(2)._Alignment= 7
_Band(0)._MapCol(3)._Name= "底薪"
_Band(0)._MapCol(3)._RSIndex= 3
_Band(0)._MapCol(3)._Alignment= 7
_Band(0)._MapCol(4)._Name= "奖金"
_Band(0)._MapCol(4)._RSIndex= 4
_Band(0)._MapCol(4)._Alignment= 7
_Band(0)._MapCol(5)._Name= "工资小计"
_Band(0)._MapCol(5)._RSIndex= 5
_Band(0)._MapCol(5)._Alignment= 7
_Band(0)._MapCol(6)._Name= "住房公积金"
_Band(0)._MapCol(6)._RSIndex= 6
_Band(0)._MapCol(6)._Alignment= 7
_Band(0)._MapCol(7)._Name= "医疗保险"
_Band(0)._MapCol(7)._RSIndex= 7
_Band(0)._MapCol(7)._Alignment= 7
_Band(0)._MapCol(8)._Name= "税前小计"
_Band(0)._MapCol(8)._RSIndex= 8
_Band(0)._MapCol(8)._Alignment= 7
_Band(0)._MapCol(9)._Name= "所得税"
_Band(0)._MapCol(9)._RSIndex= 9
_Band(0)._MapCol(9)._Alignment= 7
_Band(0)._MapCol(10)._Name= "实发工资"
_Band(0)._MapCol(10)._RSIndex= 10
_Band(0)._MapCol(10)._Alignment= 7
_Band(0)._MapCol(11)._Name= "计发时间"
_Band(0)._MapCol(11)._RSIndex= 11
End
Begin VB.Menu g1
Caption = ""
NegotiatePosition= 2 'Middle
WindowList = -1 'True
End
End
Attribute VB_Name = "FrmShowGrid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDelete_Click()
Dim row As Integer
Dim i As Integer
i = 1
row = Grid1.RowSel
Adodc1.Recordset.MoveFirst
If Grid1.Rows > 2 Then
'找出鼠标选中的记录
While (i < row)
Adodc1.Recordset.MoveNext
i = i + 1
Wend
'删除该记录
Adodc1.Recordset.Delete
Grid1.RemoveItem row
Adodc1.Recordset.UpdateBatch
Else
MsgBox "不能删除最后一行!", vbOKOnly + vbExclamation, "提示信息"
End If
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -