hey, im in my final year of school and im completing a coarse in software development.
We are completing a simple task at the moment of typing an integer into a test box and having it be displayed. This is simple however we have to have a try and catch statement where if a non-integer is inserted it wont freeze up.
the code looks like this so far:
can anyone see the issue and if so could someone give me some tips to basic structure of codeCode:Public Class Form1 Private Sub Btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnexit.Click End End Sub Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclear.Click txtEnter.Text = "" End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtEnter.TextChanged End Sub Private Sub btnInteger_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInteger.Click 'Dim I As Integer Dim str As String lbldisplay.Text = Integer.Parse(str) Try Console.WriteLine("In Try...Block Code") lbldisplay.Text = Integer.Parse(str) Catch d As NullReferenceException Console.WriteLine("Error!!! ... In cash block") Console.WriteLine("Nullreferenceexception Caught") ' not complete with errors Catch ex As Exception End Try End Sub End Class
i have no idea myself
SOMEONE PLEASE HELP
HELP!!
thnx for reading
i also have the files if you need them
thnx


LinkBack URL
About LinkBacks




Reply With Quote



Bookmarks