How to include a C# class in VB.net?

G

Guest

Hi

I have a C# class that I like to reference it from v

Dim dib As DibGraphicsBuffe

Where DibGraphicsBuffer is C# class. How would I use this class in my VB project

I tried to add this single C# class to by VB but still it doesn’t recognize the DibGraphicsBuffer class. What I am doing wrong

Thank
A
 
B

Brian Henry

just add it as a reference , that is all you have to do

to access it you need to do an import on the reference after you added it's
reference.


if you had a c# class called "CreateGraphic.DLL" you would add a reference
to it in the projects references folder... then if it's namespace was
"Graphics" you would do this in your code file

Imports Graphics

that should get you access to that namespace in that dll



Al B. said:
Hi

I have a C# class that I like to reference it from vb

Dim dib As DibGraphicsBuffer

Where DibGraphicsBuffer is C# class. How would I use this class in my VB project?

I tried to add this single C# class to by VB but still it doesn't
recognize the DibGraphicsBuffer class. What I am doing wrong?
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?QWwgQi4=?= said:
I have a C# class that I like to reference it from vb

Dim dib As DibGraphicsBuffer

Where DibGraphicsBuffer is C# class. How would I use this class in my VB project?

Create a C# class library project, add it to your solution, set a
project reference, import the library's namespace and use the class...
 

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

Top