天子,好长时间不见了.没有想到竟然去练VB.Net,几重了?在工程中添加引用就可以,然后是"项目",只要你的VB.Net是输出dll的,就可以引用.

解决方案 »

  1.   

    三个星啦:-),给你加点分!趁着别人没来:-)我自然不会背叛c#,我在公司是c#强硬派:-)问题是这样的,我的主控程序给他一个button作为按钮,然后调用他的页面用dll,能实现吗?
      

  2.   

    能实现的,看看这篇文章,有问题接着问. 没有问题也常来论坛灌灌水(技术相关的水). 好处时间没有看到你,是不是升官了?将VB.Net的程序做成dll. C#这样使用.参考下面两个例子,如果是要Form,第一个.如果是控件,第二个
    http://www.syncfusion.com/faq/winforms/search/709.asp
    [C#]
         try
         {
              Assembly tempAssembly = Assembly.GetExecutingAssembly();
              // if class is located in another DLL or EXE, use something like
              // Assembly tempAssembly = Assembly.LoadFrom("myDLL.DLL");
              // or
              // Assembly tempAssembly = Assembly.LoadFrom("myEXE.exe");          Form frm1 = (Form) tempAssembly.CreateInstance(textBox1.Text);// as Form;
              frm1.Show();
         }
         catch(Exception ex)
         {
              MessageBox.Show("Error creating: "+ textBox1.Text);
         } 
    2.12 How do I dynamically load a control from a DLL
    http://www.syncfusion.com/faq/winforms/search/709.asp
      

  3.   

    做成装配件(DLL),然后在C#中引用
      

  4.   

    将你用vb的项目加到c#的解决方案上来然后在c#的项目上引用VB的项目和VB的运行库
    就可以了