Click here to Skip to main content
13,140,231 members (47,540 online)
Rate this:
Please Sign up or sign in to vote.

I want to create an interface for a usercontrol in so I can use usercontrols in different .dll's in the same way.

(Like toolbars in webbrowsers so my parentprogram have to ask some things and there will be an event of the usercontrol that should be handled by the form itselve.)

So my question is:
Do I have to specify that it's a usercontrol?
If so, how do you set in your interface?

Thanks for your reply,


Posted 6-Jul-12 11:48am
What that "specification" could possibly mean?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

No, you don't have to. Why? And what "specify that it's a user control" would mean? Not that you need or need not to do it, the whole notion makes no sense. Do you understand what is the type? Inheritance? Run-time vs compile-time type? You should understand it all and a lot more to do some programming. A type is a type, there is nothing to specify.


Thank you for explanation of your goals. Here is what you need to understand about the UserControl. The class System.Windows.Controls.UserControl had no essential additional functionality compared to its base class System.Windows.Controls.ContentControl and the class System.Windows.Forms.UserControl had no essential additional functionality compared to its base class System.Windows.Forms.ContainerControl. Please see:[^],[^].

The main purpose of user control classes is that they can cooperate with the Designer. Now, the Designer is the tool for creation of simple ad-hoc controls quickly. If you try to do a bit more serious work with the Designer, you just waste time, because using the Designer is all manual ineffective work. So, it's hard to say if the user controls classes can make a good plug-in interface. I would rather advise to base you plug-in interfaces on the class System.Windows.Controls.Control or System.Windows.UIElement for WPF or the class System.Windows.Forms.Control, to give the plug-in developers more comprehensive palette of development capabilities where user control would be just one of the ways to develop the UI plug-ins.

wimvr 7-Jul-12 18:52pm

Thank you for your reply ;-).
I know the basics of inheritance from java. Now I know what I have to know, you can not 'make' a template of a usercontrol itself (so the compiler do not know whether the interface is a usercontrol or not). (Don't know if it's right what I'm saying, normally don't speak English)

My plan is to make plugins that only contains a usercontrol (and it's functionality), so that's why those questions. Now I know how I can do it ;-)
You are welcome. Please see the update, after [EDIT].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 7 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100