public static void LoginStateChange(bool State) { if (LoginForm.username_box.InvokeRequired) { LoginChangeSateCallBack d = new LoginChangeSateCallBack(LoginStateChange); LoginForm.username_box.Invoke(d, new object[] { State }); } else { username_box.Enabled = State; password_box.Enabled = State; sing_in.Enabled = State; settings.Enabled = State; remember_me.Enabled = State; } }
public static void LoginStateChange(bool State) { if (Form1.UsernametextBox.InvokeRequired) { LoginChangeSateCallBack d = new LoginChangeSateCallBack(LoginStateChange); Form1.UsernametextBox.Invoke(d, new object[] { State }); } else { UsernametextBox.Enabled = State; PasswordtextBox.Enabled = State; LoginButton.Enabled = State; SettingsButton.Enabled = State; checkBox1.Enabled = State; } }