How can I apply an Interface to a form class
partial class Form1 : Form, InterfaceA
Is this correct?
Basically I would like to implement an Interface on a form. How To ....
How can I apply an Interface to a form class
partial class Form1 : Form, InterfaceA
Is this correct?
Basically I would like to implement an Interface on a form. How To ....
A Form is just a class (that subclasses System.Windows.Forms.Form), so yes - standard syntax is fine, as you have it.
Edit: As to your partial class part of the question, no, you need only declare that you implement the interface once. From MSDN...
If any of the parts are declared abstract, then the entire type is considered abstract. If any of the parts are declared sealed, then the entire type is considered sealed. If any of the parts declare a base type, then the entire type inherits that class.
Remember, there's no magic in forms or partial classes. C#/.Net is one of the few Microsoft projects that's wizardry free - it really does tend to behave the way you think it should.
When working with partial classes in C#, either:
To make life easier for yourself, add the interface specs in only one place (without checking I suspect this is in the designer class part by default when working with the WinForms designer).