Using VB.Net 2005 Express on Windows Vista. Modifying an open source program, so I am not the original author.
On an existing form, I created a standard textbox named txtProgress. Tried to refer to the textbox in the form’s code module with the following statement:
txtProgress.text = “fred”
and was greeted with this error message:
Error 2 Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.
The procedure where I am trying to add the line is defined with this line:
Public Shared Function MergeShapefiles(ByVal InSFs() As String, ByVal OutSF As String, ByVal FilterDupsByGeometry As Boolean, ByVal FilterDupsByAttributes As Boolean, ByVal FilterDupsBySingleAttribute As String) As Boolean
I am not familiar with the “Shared” parameter on the Function declaration, but it appears to affect the way that a textbox is allowed to be referenced. How do I reference a textbox on the form from within the Shared Function?
Thanks.