PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
How to call C# form from a VB.NET form????-VBForums
Results 1 to 4 of 4

Thread: How to call C# form from a VB.NET form????

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,086
    Compile your C# form as Class Library (output = yourproj.dll) . reference that dll in your VBproj , then something like this :

    VB Code:
    1. Dim  csharpfrm As New YourCsharpProj.Form1
    2. csharpfrm.Show()

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70

    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.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,086
    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:
    1. Dim myCsharpFrm As New YourCsharpprojname.Form1()
    2. 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
  •  



Featured


Click Here to Expand Forum to Full Width