Using Visual Studio 2019 Accidently renamed Form1 instead of a TextBox and then renamed it Form1. Have Form1.vb and Form1.Designer.vb
Created a Dialog1, but VS says that it has not been shared.
Dialog1.errLabel.Text = "Please enter a full TN"
Dialog1.Show()
Dialog1.TopMost = True
CodePudding user response:
I found somewhere something that eliminated the error message:
Public Dialog1 as Object
But it did not work. So I deleted the Dialog.vb and "Public Dialog1 as Object" and then recreated the Dialog.
Now when it gets to:
Dialog1.errLabel.Text = "Please enter a full TN"
It says:
System.NullReferenceException: 'Object variable or With block variable not set.'
CodePudding user response:
create code
If InputBox("please enter your name", "name") = "name" Then
TextBox1.ReadOnly = False
Else
TextBox1.ReadOnly = True
End If