|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
can I use Imports with a VB2005 class namespace?Hello,
I have a project (vb2005) and I added a class (a vb file) that resides in a separate directory from the main project. Rather than instantiating objects from this class to use its properties and methods, is it possible to use the Imports keyword like in C# to import that class namespace? How can this be done? or how can something equivalnet be done? Thanks, Rich "Rich" <R***@discussions.microsoft.com> schrieb: You can assign a namespace to the file using the 'Namespace' block. Then > I have a project (vb2005) and I added a class (a vb file) that resides in > a > separate directory from the main project. Rather than instantiating > objects > from this class to use its properties and methods, is it possible to use > the > Imports keyword like in C# to import that class namespace? you can import the namespace and instantiate/use the class. In addition you can even import the class in order to be able to access its shared members without qualification by the class name. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> I think I figured this out. I gieve the added class a namespace name
(without including the project name as part of the namespace unlike C#). Then when I type Imports in the main class I will see the project name in the initial listing, I select the project name, then I see the class(es) I add to the project. Show quoteHide quote "Rich" wrote: > Hello, > > I have a project (vb2005) and I added a class (a vb file) that resides in a > separate directory from the main project. Rather than instantiating objects > from this class to use its properties and methods, is it possible to use the > Imports keyword like in C# to import that class namespace? > > How can this be done? or how can something equivalnet be done? > > Thanks, > Rich Rich,
Did you look at the answer from Herfried, seems for me quiet the same. The times of sending are equal, but I get the idea because that there is no reply on Herfried answer that you did not even look at that. Knowing that set you on a lower answering priority. Cor Show quoteHide quote "Rich" <R***@discussions.microsoft.com> schreef in bericht news:8566ED0D-115D-49B3-9149-9EE8311BE22F@microsoft.com... >I think I figured this out. I gieve the added class a namespace name > (without including the project name as part of the namespace unlike C#). > Then when I type Imports in the main class I will see the project name in > the > initial listing, I select the project name, then I see the class(es) I add > to > the project. > > "Rich" wrote: > >> Hello, >> >> I have a project (vb2005) and I added a class (a vb file) that resides in >> a >> separate directory from the main project. Rather than instantiating >> objects >> from this class to use its properties and methods, is it possible to use >> the >> Imports keyword like in C# to import that class namespace? >> >> How can this be done? or how can something equivalnet be done? >> >> Thanks, >> Rich
Conversion
DLL created in .NET cannot use? (Inno Setup) Drawing images in different shapes VB.Net Merging Datasets Incorrect behavior of IIf in VB.NET (.NET Framework 1.1 SP1) problem in converting to C# Getting error LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in atlmincr database connection Remove x number of charaters from string. Vb.net Trouble Instanciating Structures |
|||||||||||||||||||||||