public void makeVisible(bool flag) { try { if (this.InvokeRequired) { MakeVisibleDelegate d = new MakeVisibleDelegate(makeVisible); this.Invoke(d, new object[] { flag }); } else { this.TopMost = flag; this.Visible = flag; } if (flag) { hk.HookStart(); } else { hk.HookStop(); } } catch (Exception) { } }
//Permite hacer visible la ventana del formulario desde un hilo diferente public void makeVisible(bool flag) { try { if (this.InvokeRequired) { MakeVisibleDelegate d = new MakeVisibleDelegate(makeVisible); this.Invoke(d, new object[] { flag }); } else { this.Visible = flag; //lockTaskManager(flag); } if (flag) { closeSessionMsg(true); hk.HookStart(); } else { hk.HookStop(); } TextBoxUser.Text = ""; TextBoxPass.Text = ""; LabelUsuario.Visible = true; LabelContraseña.Visible = true; TextBoxUser.Visible = true; TextBoxPass.Visible = true; BotonValidarUsuario.Visible = true; LabelIngreseNombreYPass.Visible = true; } catch (Exception) { } }