Hi @harshit singh ,
Suppose you have a TextBox, and you're trying to access its Text
property:
Dim userInput As String = myTextBox.Text
If myTextBox
has not been instantiated, you'll get the error. Fix it by ensuring myTextBox
is assigned:
If myTextBox IsNot Nothing Then
Dim userInput As String = myTextBox.Text
Else
' Handle the case where myTextBox is Nothing
End If
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.