Refrencing another project class

  • Thread starter Thread starter JPS
  • Start date Start date
J

JPS

When I have two projects open in a solution and I want a class from
one to refrence/inherit from the class of another, what is the proper
syntax. I know it has to do with the namspaces, but I'm not 100% sure
 
Add a reference in the referring project. Optionally include the namespace
in a using statement at the top of referring class file. Refer to the
referenced assembly using either the fully qualified name (if you haven't
included a using statement), or an unqualified name if you have.

HTH


Peter
 
1) Set a reference to the solution project containing the class you want to
derive frrom.
2) add a using <namespace> at the top of your new class

3) Define your class to derive from the other class as follows:

public class MyNewClass : MyClassToInheritFrom

That's it!
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top