Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

backspacing in text box

$
0
0

this is kind of an odd question but i'm having trouble with an error in vb 2012 its a wpf. but here it is, everything works great as far as inputing the initial numbers into the text boxes and getting the desired result and how its display, but since it requires division its throwing me an error when i back space in the "net/sub" text box all the way so there is no text just the flashing cursor it throws me an error to break or continue and it has me back to the vb editor, is there a way around this. here is my code:

  Private Sub NetIssueOne_TextChanged(sender As Object, e As EventArgs) Handles NetIssueOne.TextChanged
        Dim net As Integer
        Dim submit As Integer
        Dim netsub As Decimal




        submit = SubmitOne.Text
        net = NetIssueOne.Text

        netsub = (net / submit) * 100


        Dim result = Math.Round(netsub, 1)

        Label1.Text = (result & "%")
    End Sub


Viewing all articles
Browse latest Browse all 12583

Trending Articles



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