1
I am creating a simple program that records the total sales and the value already earned with sales, however, after the user put the sale value the error program.
The error is as follows:
Conversion of string " to integer type is not valid
Before it was working right, however only had 1 IF, now I have in total 10 IF, which register according to the number of sales the value in different variables, the code in question:
Public Class addvenda
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles boxvenda.TextChanged
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If My.Settings.numerovendas = 0 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda1 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 1 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda2 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 2 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda3 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 3 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda4 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 4 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda5 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 5 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda6 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 6 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda7 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 7 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda8 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 8 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda9 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
If My.Settings.numerovendas = 9 Then
My.Settings.vendas += 1
My.Settings.numerovendas += 1
My.Settings.venda10 = boxvenda.Text
My.Settings.totalvendas += boxvenda.Text
Me.Close()
End If
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
End Sub
End Class