Dim i As Integer
Try
i = Integer.Parse(TextBox1.Text)
Catch ex As FormatException
handle invalid data type here
Catch ex As OverflowException
handle nuber being too large here
Catch ex As Exception
anything else here
MessageBox.Show(ex.ToString)
End Try
MessageBox.Show(GetType(Exception).ToString())