Hi
I am fairly new to visual studio .net and after setting up a couple of
applications I have decided to introduce a library of components that I can
use for future projects
I have set up a simple component thats was shown as an example in a book .
---------------------------------------------------------------------------------
Public Class hello
Inherits System.ComponentModel.Component
component designer generated code
Public Function sayhello() As String
Return "hello !!"
End Function
End Clas
-----------------------------------------------------------------------------------------------
This compiles ok.
In another project i try to access this component and although the project
knows about the hello function I get an error when i try to refer to
hello.sayhello
the message i get is " Reference to a non-shared member requires an object
reference".
Label1.Text = Library1.hello.sayhello
The .dll associated with the component is stored in the same location as the
project.
Many thanks if anyone can give me any inspiration
Peter
Kevin Spencer - 13 Jun 2005 15:58 GMT
A class is not an instance of a class. You create an instance by using the
New operator. Otherwise, you must create a Shared member in order to use the
member without an instance of the class.

Signature
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.
> Hi
>
[quoted text clipped - 31 lines]
>
> Peter