Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim X As Integer = 1
- Dim Impares As Integer
- Dim Pares As Integer
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- If X > 20 Then
- Button1.Enabled = False
- MsgBox(Impares)
- MsgBox(Pares)
- Else
- ListBox1.Items.Insert(X, txtv1.Text)
- End If
- X += 1
- For Cont As Integer = 1 To ListBox1.Items.Count
- If (ListBox1.SelectedItem.Value / 2) <> 0 Then
- Impares += ListBox1.SelectedItem.Value
- Else
- Pares += ListBox1.SelectedItem.Value
- End If
- Next
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement