private void SetTime(string text) { if (this.textBoxTime.InvokeRequired) { SetTimeCallback d = new SetTimeCallback(SetTime); this.Invoke(d, new object[] { text }); } else { this.textBoxTime.Text = text; } }
private void SetTime(object time, int minute) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.lblThoiGian.InvokeRequired) { SetTimeCallback d = new SetTimeCallback(SetTime); this.Invoke(d, new object[] { time, minute }); } else { this.lblThoiGian.Text = time.ToString() + " PhĂșt"; counter = minute * 60; countdown.Enabled = true; } }
private void SetTime(TimeSpan elapsed) { if (lvHours.InvokeRequired) { SetTimeCallback d = new SetTimeCallback(SetTime); this.Invoke(d, new object[] { elapsed }); } else { _currentProject.ListItem.SubItems[4].Text = string.Format("{0}:{1:00}:{2:00}", elapsed.Hours, elapsed.Minutes, elapsed.Seconds); lvHours.Update(); } }
private void SetTime(string txt) { if (this.txtTimer.InvokeRequired) { SetTimeCallback d = new SetTimeCallback(SetTime); Invoke(d, new object[] { txt }); } else { this.txtTimer.Text = txt; } }