I’m facing this problem (i’ll make it short and easy)
In form1 i need to create an instance of Login form and be able to access it in the class abc and use it’s(login’s) method.However, it appears to be inaccessible.
I hope i said all the relevant in an understandable.
Thanks in advance
Fundamentally to do exactly what you ask, you need to provide an instance of
Logintoabc, for example by passing it in through theabcconstructor.You may wish to consider refactoring some of the functionality currently in
Loginform to make it useful in all places it’s needed.I suggest having a look at the MVC pattern. While WPF, Silverlight and ASP.Net MVC provide strong support for that pattern, you can certainly apply it in a WinForms scenario as well.
Using a pattern like MVC will make your code far easier to evolve and maintain over time.