【VB开源代码栏目提醒】:本文主要为网学会员提供showEmployee.frm,希望对需要showEmployee.frm网友有所帮助,学习一下!
VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form showEmployee
BorderStyle = 1 'Fixed Single
Caption = "员工基本信息
列表"
ClientHeight = 5415
ClientLeft = 45
ClientTop = 330
ClientWidth = 9900
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5415
ScaleWidth = 9900
StartUpPosition = 2 '屏幕中心
Begin MSDataGridLib.DataGrid DataGrid1
Height = 5310
Left = 30
TabIndex = 0
Top = 60
Width = 9825
_ExtentX = 17330
_ExtentY = 9366
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Attribute VB_Name = "showEmployee"
Attribute
VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub DataGrid1_DblClick()
On Error Resume Next
For i = 0 To frmSys_person.txtPerson.Count - 1
frmSys_person.txtPerson(i).Text = frmSys_person.adoEmployee.Recordset.Fields(i).Value
Next i
Me.Hide
End Sub
Private Sub Form_Load()
frmSys_person.adoEmployee.RecordSource = "select * from tbOA_employee"
frmSys_person.adoEmployee.Refresh
Set DataGrid1.DataSource = frmSys_person.adoEmployee '绑定frm_mainBack窗体的adoDept控件
DataGrid1.Columns(0).Caption = "员工编号" '设置表格标题
DataGrid1.Columns(1).Caption = "员工"
DataGrid1.Columns(2).Caption = "性别"
DataGrid1.Columns(3).Caption = "出生日期"
DataGrid1.Columns(4).Caption = "所属部门"
DataGrid1.Columns(5).Caption = "职务"
DataGrid1.Columns(6).Caption = "学历"
DataGrid1.Columns(7).Caption = "政治面貌"
DataGrid1.Columns(8).Caption = "电话"
DataGrid1.Columns(9).Caption = "备注"
End Sub