Dim kjs() As String = {"TextBox1", "Textbox2"}Dim tss() as string = {"姓名","年龄"}For i as integer = 0 to kjs.length - 1 If e.form.controls(kjs(i)).Text = "" Then msgbox(tss(i) & "不能为空") Return End IfNext