|
-
Dec 4th, 2003, 11:41 AM
#1
Thread Starter
Lively Member
How to call C# form from a VB.NET form????
Hi,
How can we call a c# form from vb.net form.
The c# form is called as csform and is in project csharps.
The VB.net form is called as vbform and is in project vbnets.
There is a button in vbform on clicking should lead to the c# form.
How can we do this. Ur help will be appreciated
-
Dec 4th, 2003, 12:08 PM
#2
Sleep mode
Compile your C# form as Class Library (output = yourproj.dll) . reference that dll in your VBproj , then something like this :
VB Code:
Dim csharpfrm As New YourCsharpProj.Form1
csharpfrm.Show()
-
Dec 4th, 2003, 03:13 PM
#3
Thread Starter
Lively Member
Thanks a lot for ur reply pirate
Hi Pirate,
Thanks a lot for your reply
But two questions
(1) How do we create dll's in VS.NET for C#.
(2) And How do we use that dll and compile in VB.NET using VS.NET
links or tutorial will be appreciated.
I once again thank you for your reply.
-
Dec 4th, 2003, 10:33 PM
#4
Sleep mode
Originally posted by cooldudeattitud
(1) How do we create dll's in VS.NET for C#.
(2) And How do we use that dll and compile in VB.NET using VS.NET
1- Create new Windows proj whether C# or VB , do you work there , after you're done , right click your project name in the Solution Explorer and Properties . In the Common item under General Properties , change the Output type to Class Library . Note applies to your first post , so that you can reference the C# form in your VB form [ if you're going to write the whole class then the type of proj should be Class Library Project ]. Anyways , right click the solution project not the project itself . Select properties , then select Configuration Properties , then Release . After this , go to Build menu , then Build Solution , your dll should be there in the bin\release.
2-After you get your dll from the C# proj , then you have to reference it in your VB.NET Proj . Open your VB Proj , right click References in Solution Explorer , then Add Reference . Browse to the C# dll you have just compiled . then press OK .Almost done , use it something like this :
VB Code:
Dim myCsharpFrm As New YourCsharpprojname.Form1()
myCsharpFrm.Show()
YourCsharpprojname= your actual C# Project name .
Form1=the form in the C# proj .
Hope that helps .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|