Dim values() As String = {"五十米","一百米","二百米"} '以此为例,其他项目可再多加
For i As Integer =0 To values.length-1
If e.Col.name = values(i) AndAlso e.Row("组别") = "女子组" Then
e.Cancel = True
MessageBox.Show("男子不能报女子组的项目!")
End If
Next
For i As Integer =0 To values.length-1
If e.Col.name = values(i) AndAlso e.Row("组别") = "男子组" Then
e.Cancel = True
MessageBox.Show("女子不能报男子组的项目!")
End If
Next