Dim dt2 As Table = Tables("初中报名_table2")
Dim c4 As String = e.Form.Controls("combobox4").text
Dim c7 As String = e.Form.Controls("combobox7").text
Dim drcj As String = c7 & "成绩"
Dim rb3 As WinForm.RadioButton = e.Form.Controls("RadioButton3")
Dim rb4 As WinForm.RadioButton = e.Form.Controls("RadioButton4")
If dt2.Rows.Count>0
If c4 > "" And c7>""
Dim p As WinForm.ProgressBar
p = e.Form.Controls("ProgressBar1")
p.Maximum = dt2.rows.Count'设置最大值
p.Minimum = 0 '设置最小值
p.Value = 0 '设置当前值
Dim i As Integer=0
Dim Arys As List(Of String) = DataTables("学生信息").GetValues("年级")
Dim n As Integer=0
For Each ary As String In arys
Dim lbs As List(Of DataRow)
If rb3.checked=True
lbs= DataTables("学生信息").Select("年级 ='" & ary & "'",drcj & " desc")
End If
If rb4.checked=True
lbs = DataTables("学生信息").S elect("年级 ='" & ary & "'",drcj)
End If
n=0
For Each lb As DataRow In lbs
Dim dr As DataRow = DataTables("成绩").find("身份证件号='" & lb("身份证件号") & "'")
If dr Is Nothing Then dr = DataTables("成绩").AddNew()
dr("学段") = "初中"
dr("班级全称")= lb("班级")
dr("考试名称")=c4
dr("身份证件号")=lb("身份证件号")
dr("单位名称")=_usergroup
dr("姓名")= lb("学生姓名")
i=i+1
p.value=i
dr("考号")=dr("年级代码") & dr("学校代码") & Format(n+1,"0000")
n=n+1
Next
Next
Forms("初中报名").Controls("Label2").text = "学生考号表" & dt2.Rows.count & "人"
Forms("初中报名").Controls("Label14").text = "学生考号表" & dt2.Rows.count & "人"
Dim dt1 As DataTable = DataTables("成绩")
Dim cb1 As WinForm.ComboBox = e.form.Controls("ComboBox1")
cb1.ComboList =" |" & dt1.GetComboListString("年级")
p.value=0
Else
messagebox.show("请选择好本次考试名称和要克隆考试名称","提示",MessageBoxButtons.OK)
End If
Else
messagebox.show("请选择好本次要参考的学生")
End If
老师,请问我想将这个代码改进为按成绩排的同时交替同年级班级,即1班成绩最高的排1号,2班成绩最高的排2班,然后依次循环