private void handleControls() { try { if (this.InvokeRequired) { threadCallBack c = new threadCallBack(handleControls); this.Invoke(c); } else { circularProgress.IsRunning = !circularProgress.IsRunning; loginControl.buttonIngresar.Enabled = !loginControl.buttonIngresar.Enabled; loginControl.textBoxUsuario.Enabled = !loginControl.textBoxUsuario.Enabled; loginControl.textBoxPassword.Enabled = !loginControl.textBoxPassword.Enabled; } } catch (ObjectDisposedException ex) { } }
void handleControlsEnabled() { if (this.txtUser.InvokeRequired) { threadCallBack c = new threadCallBack(handleControlsEnabled); this.Invoke(c); } else { this.txtUser.Enabled = !this.txtUser.Enabled; if (this.txtPassword.InvokeRequired) { threadCallBack c = new threadCallBack(handleControlsEnabled); this.Invoke(c); } else { this.txtPassword.Enabled = !this.txtPassword.Enabled; if (this.btnIngresar.InvokeRequired) { threadCallBack c = new threadCallBack(handleControlsEnabled); this.Invoke(c); } else { this.btnIngresar.Enabled = !this.btnIngresar.Enabled; if (this.btnCancelar.InvokeRequired) { threadCallBack c = new threadCallBack(handleControlsEnabled); this.Invoke(c); } else { this.btnCancelar.Enabled = !this.btnCancelar.Enabled; } } } } }
private void showEnvironment() { if (this.InvokeRequired) { threadCallBack c = new threadCallBack(showEnvironment); this.Invoke(c); } else { this.Hide(); Entorno entorno = new Entorno(usuario); entorno.ShowDialog(); Application.Exit(); } }
void handleProgressBar() { if (this.cpbConectando.InvokeRequired) { threadCallBack c = new threadCallBack(handleProgressBar); this.Invoke(c); } else { cpbConectando.IsRunning = !cpbConectando.IsRunning; } }
void selectTxtUser() { if (this.txtUser.InvokeRequired) { threadCallBack c = new threadCallBack(selectTxtUser); this.Invoke(c); } else { this.txtUser.Focus(); this.txtUser.SelectAll(); } }
void ocultarLogin() { if (this.InvokeRequired) { threadCallBack c = new threadCallBack(ocultarLogin); this.Invoke(c); } else { this.Hide(); } }