The fact is that I have a "login window" and "mainwindow", which is called after pressing the login button or the "VISITOR" button
If you press the login button, the whole system will exit, and if I press the VISITANT button, one tab should disappear or be locked or something like that.
private void visitant(object sender, EventArgs e) { mainwindow menu = new mainwindow(); menu.Show(); //mainwindow.tabPage1.Enabled = false; //attempt1 //mainwindow.tabPage1.Visible = false; //attempt1 //System.Windows.Forms.tabPage1.Enabled = false;//attempt2 //System.Windows.Forms.tabPage1.Visible = false;//attempt2 this.Hide(); }
the errors I get for using try1,
Error 1 'System.mainwindow.tabPage1' is unavailable due to the level of protection '
Error 2 An object reference is required for a non-static field, method or property "System.mainwindow.tabPage1"
and the one I get to use try2,
Error 1 The type or namespace name "tabPage1" does not exist in the namespace "System.Windows.Forms" (do you miss the assembly reference?)
as you probably guessed, "tabPage1" is the tab that I need to hide when I click the visitor button.
I canβt come up with more details, I will be there to provide additional information.
Thanks in advance.
Audel source share