Conversion from string to integer error

I simply want to substract two Text box and out put the result but I’m getting this:

System.InvalidCastException: ‘Conversion from string “” to type ‘Integer’ is not valid.’

Inner Exception

FormatException: Input string was not in a correct format.

I am only inputting numbers.

Here’s the code:

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Dim QOH As Integer = CInt(qih.Text) Dim Qin As Integer = CInt(qi.Text) Dim Qout As Integer = CInt(qo.Text) QOH = Qin - Qout End Sub 

submitted by /u/Walkerstain
[link] [comments]

Leave a Reply