Hey guys,
I'm new at this vb.net thing and have a question. Why can't I make a call to TextBox1.text from within the shared sub main(). It tells me "Cannot refer to an instance member of a class from within a shared method, bla, bla ,bla..."
What am I missing?
Comments
: Hey guys,
:
: I'm new at this vb.net thing and have a question. Why can't I make a call to TextBox1.text from within the shared sub main(). It tells me "Cannot refer to an instance member of a class from within a shared method, bla, bla ,bla..."
:
: What am I missing?
:
:
: I'm new at this vb.net thing and have a question. Why can't I make a call to TextBox1.text from within the shared sub main(). It tells me "Cannot refer to an instance member of a class from within a shared method, bla, bla ,bla..."
:
: What am I missing?
:
Shared methods can only access shared properties. Reason being that the runtime has no way to determine which object instances property value to use.
: :
: : I'm new at this vb.net thing and have a question. Why can't I make a call to TextBox1.text from within the shared sub main(). It tells me "Cannot refer to an instance member of a class from within a shared method, bla, bla ,bla..."
: :
: : What am I missing?
: :
:
: Shared methods can only access shared properties. Reason being that the runtime has no way to determine which object instances property value to use.
:
If you need to use the value in your textbox throughout the program, you will need a global variable. Assign the value to the variable, then call the variable, not the textbox.text property.