Your problem occurs because you don't have a reference to the Menu_View
object inside your function, so it tries to reference the Menu_View
class, which doesn't have any static members assigned. It looks like what you want to do is call Login_View.MdiParent.SetMenuView()
EDIT
You probably need to cast your call, as you are saving Main_Menu
into LoginView.MdiParent
which stores it as it's base class Form
. Try: (Main_Menu)Login_View.MdiParent.SetMenuView()
If casting the object isn't possible, then what you can do is create a Property to access the object directly.
In your User_Login_View
, create a new property public Menu_View Menu {get;set;}
. Then, in your Show_Login
function, add a line to set the Menu
object LoginView Menu = Main_Menu;
. Now, you can reference LoginView.Menu.SetMenuView();
without needing a cast.