我创建了一个表单,我希望它可以控制课程注册过程。
所以我的代码如下
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim InpName As String
For i = 1 To 4
InpName = InputBox("What course do you want to register")
If InpName = "computer literacy" Then
TextBox1.Text = InpName
ElseIf InpName = "engineering" Then
TextBox1.Text = InpName
Else
MsgBox("We only offer computer literacy and engineering")
End If
Next i
我希望循环接受计算机知识或工程 4 次,并告诉用户计算机知识课程或工程课程已满。