加入工程的User Control 还要引用吗?
怎么引用?

解决方案 »

  1.   

    是在工程中加入的User Control ,在VB里关闭控件设计窗口,就可以在同一工程里的Form上画上这个控件啦,看c#的帮助
    Authoring User ControlsSee Also
    Walkthrough: Authoring a User Control With Visual Basic .NET | Walkthrough: Inheriting from a Windows Forms Control with Visual Basic .NET | Control Type Recommendations | Authoring Controls for Windows Forms
    User controls can be employed in many ways. You can author them as part of a Windows desktop application project, and use them only on forms in the project. Or you can author them in a Windows Control Library project, compile the project into an assembly, and use the controls in other projects. You can even inherit from them, and use visual inheritance to customize them quickly for special purposes.Note   If you want to author a user control to use on Web Forms, see Developing ASP.NET Server Controls.
    To author a user control Open a new Windows Application project. 
    On the Project menu, click Add User Control. 
    Add controls from the Toolbox to the user control surface. 
    Place code in event procedures, to handle events raised by the UserControl or by its constituent controls. 
    Close the designer for the user control, and save the file. 
    Give the class file (.vb or .cs file) the name you want the user control to have. 
    On the Build menu, click Build. 
    The project must be built in order for user controls to appear in the Toolbox. Use the Windows Forms tab of the Toolbox to add instances of your control to Form1. 也是这样做啊,为什么总是出错???????
      

  2.   

    没有创建静态对象,虽然他不用实例化,但在.cs文件里还是要创建protected userControl userConttrol= null;
      

  3.   

    在引用中,引用WEB控件,后在工具框中同样引用控件,再将控件画到窗体上。