Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2010 [RESOLVED] Need help converting textbox numbers into integers

$
0
0
I'm creating a temperature convertor in Visual Basic 2010. I have the code working, but I need it to convert the result of the conversion into an integer. I've tried, but no success.
I'm trying to convert it using CInt, without the use of if statements. Here is my current code, if anyone could help, I'd greatly appreciate it. I'm new to using Basic, if that isn't obvious.


Code:

Public Class Form1

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFahrNumber.TextChanged


    End Sub

    Private Sub btnFtoC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFtoC.Click
        txtCelsiusNumber.Text = (txtFahrNumber.Text - 32) * (5 / 9)
        imgboxArrow.Image = (My.Resources.ArrowBlkR)
    End Sub

    Private Sub btnCtoF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCtoF.Click
        txtFahrNumber.Text = (txtCelsiusNumber.Text) * (9 / 5) + 32
        imgboxArrow.Image = (My.Resources.ArrowBlkL)
    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        txtCelsiusNumber.Clear()
        txtFahrNumber.Clear()
        imgboxArrow.Image = Nothing
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Application.Exit()
    End Sub
End Class


Viewing all articles
Browse latest Browse all 27189

Trending Articles



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