locked
VB.NET DLL project add reference to usercontrol RRS feed

  • Question

  • I am developing an application that will take dll's as plugins. There is a region on the main form dedicated to any UI elements that are needed for configuration of the dll code. I am trying to create a usercontrol in my dll project and it is just giving me the code files rather than a designer like it should.

    Wondering what references i need to add to my project to make it work normally?

    Thursday, March 7, 2019 2:36 AM

All replies

  • Hi,

    I made a demo about usercontrol,project name is WindowsControlLibrary1,class name UserControl1,reference dll

    2.add the usercontrol to another project

    Imports System.ComponentModel
    Imports System.Drawing
    Imports System.Windows.Forms
    Imports WindowsControlLibrary1
    
    
    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            Me.Controls.Add(New UserControl1)
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 7, 2019 7:00 AM
  • I think there is a misunderstanding.

    I want to add the design components of a user control into the DLL project.

    I do not want to create a user control, and then import it into the new project.

    Friday, March 8, 2019 11:51 PM
  • Hi,

    I know what you mean:

    1.dll add usercontrol

    2.fix code:

    3.reference dll

    Imports System.ComponentModel
    Imports System.Drawing
    Imports System.Windows.Forms
    Imports ClassLibrary1
    
    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim t As New UserControl1
            Me.Controls.Add(t)
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 11, 2019 3:35 AM