Quantcast
Channel: VBForums - Code It Better
Viewing all articles
Browse latest Browse all 16

Simple adding windows program

$
0
0
Hello guys,

I was programming this simple adding numbers program and I thought about developing it more and more

The First code is :

Code:

        Dim number1, number2, sum As Integer
   
        number1 = TextBox1.Text
        number2 = TextBox2.Text
        sum = number1 + number2
        TextBox3.Text = sum
        MessageBox.Show("Thank you for using me.")

Not that text box 3 is read only !

Now I want to make the program give an error message it the input in textbox1 and textbox2 was nothing or not integer (number)

How i do that

I tried :

Code:

if TextBox1.Text = "" then
MsgBox("ERROR")


end if

but I keep getting error that it cannot convert Integer to String !

Any Ideas ??


THANKS,

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>