📄 form_pj_list.frm
字号:
End
End
Begin MSComctlLib.ListView ListView1
Height = 4335
Left = 2640
TabIndex = 7
Top = 0
Width = 5775
_ExtentX = 10186
_ExtentY = 7646
View = 3
Arrange = 1
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = 0 'False
AllowReorder = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
PictureAlignment= 5
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483634
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 5
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "学号"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "姓名"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "班级"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "性别"
Object.Width = 2540
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "政治面貌"
Object.Width = 2540
EndProperty
Picture = "form_pj_list.frx":3B1F8
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "form_pj_list.frx":4F10C
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "form_pj_list.frx":4F268
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "form_pj_list"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public jl_id As String
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
On Error GoTo 1
Dim myform As New form_one_info
kk = ListView1.SelectedItem.Key
ll = Right(kk, Len(kk) - 1)
myform.student_id = ll
myform.Show 1
1
End Sub
Private Sub Form_Load()
Dim year_name As String
Dim cc As New ADODB.Recordset
cc.Open "select * from [gz] where [ID]=" & jl_id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
year_name = cc.Fields("xn")
End If
cc.Close
Label4.Caption = year_name & "-" & (year_name + 1)
Dim itmX As ListItem
ListView1.ListItems.Clear
Dim recordset_temp As New ADODB.Recordset
recordset_temp.Open "select * from [student] where [ID] in (select [stid] from [jc] where [gzid]=" & jl_id & ")", main.connect, 3, 2
For i = 1 To recordset_temp.RecordCount
Set itmX = ListView1.ListItems.Add(, "b" & recordset_temp.Fields(0), recordset_temp.Fields(3), 1, 1)
itmX.SubItems(1) = recordset_temp.Fields(1)
itmX.SubItems(2) = getclass(recordset_temp.Fields(5))
If recordset_temp.Fields(2) = True Then
itmX.SubItems(3) = "男"
Else
itmX.SubItems(3) = "女"
End If
Select Case recordset_temp.Fields(4)
Case 1
itmX.SubItems(4) = "团员"
Case 2
itmX.SubItems(4) = "党员"
Case 0
itmX.SubItems(4) = "无"
End Select
recordset_temp.MoveNext
Next
recordset_temp.Close
Label1.Caption = getpc(jl_id)
End Sub
Private Sub Form_Resize()
Picture1.Height = Me.Height - 400
Command1.Top = Me.Height - Command1.Height - 450
Command1.Left = Me.Width - Command1.Width - 200
Command2.Top = Command1.Top
Command2.Left = Command1.Left - Command2.Width - 200
ListView1.Width = Me.Width - Picture1.Width - 200
ListView1.Height = Command1.Top - 100
End Sub
Private Function getpc(id As String) As String
Dim cc As New ADODB.Recordset
Dim temp As String
temp = ""
cc.Open "select * from [gz] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = "[" & cc.Fields(1) & "]" & temp
id = cc.Fields(5)
End If
cc.Close
cc.Open "select * from [gz] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = "[" & cc.Fields(1) & "]" & temp
id = cc.Fields(5)
End If
cc.Close
cc.Open "select * from [gz] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = "[" & cc.Fields(1) & "]" & temp
id = cc.Fields(5)
End If
cc.Close
cc.Open "select * from [gz] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = "[" & cc.Fields(1) & "]" & temp
id = cc.Fields(5)
End If
cc.Close
getpc = temp
End Function
Private Function getclass(id As Integer) As String
Dim cc As New ADODB.Recordset
Dim temp As String
temp = ""
cc.Open "select * from [class] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = cc.Fields(1) & "班"
id = cc.Fields(2)
End If
cc.Close
cc.Open "select * from [yc] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = cc.Fields(1) & "级" & temp
id = cc.Fields(2)
End If
cc.Close
cc.Open "select * from [zy] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = cc.Fields(1) & "专业" & temp
id = cc.Fields(2)
End If
cc.Close
cc.Open "select * from [zy] where [ID]=" & id, main.connect, 3, 2
If cc.RecordCount <> 0 Then
temp = cc.Fields(1) & "系" & temp
End If
cc.Close
getclass = temp
End Function
Private Sub ListView1_DblClick()
Command2_Click
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -