How to make a VB exception handling for no value in a Textbox

Posted by Twocold on Stack Overflow See other posts from Stack Overflow or by Twocold
Published on 2012-10-20T10:57:20Z Indexed on 2012/10/20 11:00 UTC
Read the original article Hit count: 133

Filed under:
|

I want to catch an exception when user enter no value in a Textbox and try to process further by press a button, I know I can use "If else" statement to make it. but in terms of "Try and Catch" block, I dont know how. Here is the code sample.

Dim NameString As String

   Try
      NameString = OperatorNameTextBox.Text
   Catch ex As ArgumentException
      MessageBox.Show("Enter a String Value")
   End Try

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about vb6