private void Mostrar() { if (this.label2.InvokeRequired) { this.label2.BeginInvoke((MethodInvoker) delegate() { this.label2.Text = Horario.AsignarHora(); } ); } else { this.label2.Text = Horario.AsignarHora(); } }
private void Metodo() { while (1 != 0) { Thread.Sleep(1000); if (this.label1.InvokeRequired) { this.label1.BeginInvoke((MethodInvoker) delegate() { this.label1.Text = Horario.AsignarHora(); } ); } else { this.label1.Text = Horario.AsignarHora(); } } }