I have used this code to fix my problem, but when I use an InputBox it doesn't work.
Private MenuMakanan() As String = {"Sate Kambing", "Sate Ayam", "Gulai", "Nasi"}
Private Sub btn_Pesan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Pesan.Click
Dim myMenu() As String = {}
Dim jml As Short = InputBox("Mau Pesan Berapa Makanan ? ")
If jml > 0 Then
ReDim myMenu(jml - 1)
For s = 0 To UBound(myMenu)
myMenu(s) = InputBox("Mau Pesan Makanan Apa ?")
If MenuMakanan.Contains(myMenu(s)) Then
lisb_Pesanan.Items.Add(myMenu(s))
End If
Next
MessageBox.Show("Terima Kasih" & vbCrLf & "Mohon tunggu sejenak", "Pesanan", MessageBoxButtons.OK)
End If
End Sub
If I enter value on InputBox, it will check that it is within the MenuMakanan() array or not, if yes it will add to lisb_Pesanan.