Reference dll as usercontrol

NachitoMax 416 Reputation points
2021-04-02T05:45:58.697+00:00

Hey

Looking for a bit of advice / guidance. My current project has many usercontrols I am using as subforms that I load into a main panel on my main form. I'd like to separate them so that I have the main form application and a collection of sub projects that I can reference the compiled dll for each user control.

My idea is that whichever dll I need a can create an instance of that and add it to the panel.

So, as a separate project, how would I create it so that it returns the user usercontrol as a usercontrol? Something like this?

Imports MyUC1

Sub Test()
Dim UC1 As UserControl = New MyUC1.UC
MyPanel.Controls.Add(UC1)
End Sub

I'd like to if I need to return as the usercontrol or simply reference the usercontrol inside the dll

Thanks

Developer technologies | .NET | Other
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.