jueves, 4 de febrero de 2010

Sentencia for basica


AQUI EL CÓDIGO

If TextBox1.Text = "" Or ComboBox1.Text = "Escoja operación" Then
MsgBox("Espacio en blanco o no se escogio operación")

Else
If ComboBox1.Text = "*" Then
For i = 1 To 12
total = i * TextBox1.Text
'MsgBox(total)

ListBox1.Items.Add(i & " " & " X " & TextBox1.Text & " = " & total)
Next
Endif
Endif

uso sentencia for dentro de visual basic 2008


Aqui el código
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Or ComboBox1.Text = "Escoja operación" Then
MsgBox("Espacio en blanco o no se escogio operación")
Else
If ComboBox1.Text = "*" Then
For i = 1 To 12
total = i * TextBox1.Text
'MsgBox(total)
ListBox1.Items.Add(i & " " & " X " & TextBox1.Text & " = " & total)
Next
Endif
Endif