Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hey!
 

I want to create an interface for a usercontrol in VB.net 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,
 
regards,
 
wimvr
Posted 6-Jul-12 12:48pm
wimvr771
Comments
Sergey Alexandrovich Kryukov at 6-Jul-12 18:45pm
   
What that "specification" could possibly mean?
--SA

1 solution

Rate this: bad
good
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.
 
[EDIT]
 
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:
http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx[^].
 
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.
 
—SA
  Permalink  
v2
Comments
wimvr at 7-Jul-12 18:52pm
   
Hey!
 
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 ;-)
Sergey Alexandrovich Kryukov at 7-Jul-12 21:18pm
   
You are welcome. Please see the update, after [EDIT].
--SA

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

  Print Answers RSS
0 OriginalGriff 245
1 Jochen Arndt 155
2 PIEBALDconsult 150
3 Afzaal Ahmad Zeeshan 120
4 DamithSL 115
0 OriginalGriff 5,695
1 DamithSL 4,591
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 7 Jul 2012
Copyright © CodeProject, 1999-2014
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