c# - Implementing an interface with a Windows Form -


i'm new using interfaces have question pretty easy of you.

i trying make interface windows form. looks like

interface myinterface {     //stuff stuff stuff }  public partial class myclass : form, myinterface {    //more stuff stuff stuff. form } 

the problem comes when try implement it. if implement with

myinterface blah = new myclass(); blah.showdialog(); 

the showdialog() function available it. makes sense- myinterface interface, not form... i'm curious how should go implementing interface windows form, or if viable option @ all.

does have suggestions how should go doing that?

thanks!

this appears question how correctly expose members of class.

internal - access method/class restricted application public - access not restricted private - access restricted current class (methods) protected - access restricted current class , inherited classes 

an example use of interface share common method signatures between classes

interface ianimal {     int feetcount(); } public class dog : ianimal {     int feetcount()     {     } }  public class duck : ianimal {     int feetcount()     {     } } 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -