public void Initialize(MainStudio mainForm, ToolStripStatusLabel mainStatusLabel, ToolStripStatusLabel rightStatusLabel) { _mainForm = mainForm; _mainStatusLabel = mainStatusLabel; _rightStatusLabel = rightStatusLabel; _labelCallBack = SetStatusLabel; }
private void SetLabel(Label lbl, string message) { if (lbl.InvokeRequired) { SetLabelCallBack d = new SetLabelCallBack(SetLabel); this.Invoke(d, new object[] { lbl, message }); } else { if (lbl == lblAuthorized) // Update the User's Authroisation Status { if (message == "Authorised") { lbl.ForeColor = Properties.Settings.Default.ForeColour; Properties.Settings.Default.IsAuthorised = true; } else { lbl.ForeColor = Properties.Settings.Default.ErrorForeColour; lbl.BackColor = Properties.Settings.Default.ErrorBackColour; Properties.Settings.Default.IsAuthorised = false; } } lbl.Text = message; } }
/// <summary> /// 스레드에서 라벨 텍스트 변경 /// </summary> public static void SetLabel(System.Windows.Forms.Label label, string str) { if (label.InvokeRequired) { SetLabelCallBack dele = new SetLabelCallBack(SetLabel); label.Invoke(dele, label, str); } else { label.Text = str; } }
private void SetLabel(string str) { if (this.lblCopy.InvokeRequired) { SetLabelCallBack del = new SetLabelCallBack(SetLabel); this.Invoke(del, new object[] { str }); } else { this.lblCopy.Text = str; } }
void SetLabel(string str) { if (lbCopy.InvokeRequired) { SetLabelCallBack callBack = new SetLabelCallBack(SetLabel); Invoke(callBack, new object[] { str }); } else { lbCopy.Text = str; } }
// t1 스레드에서 만들어진 값(str)을 메인스레드(폼)의 레이블에 지정하기 위한 메소드 private void SetLabel(string progStr) { if (this.label2.InvokeRequired) { SetLabelCallBack dele = new SetLabelCallBack(SetLabel); this.Invoke(dele, progStr); } else { this.label2.Text = progStr; } }
private void SetLabel() { if (this.label1.InvokeRequired) { SetLabelCallBack dele = new SetLabelCallBack(SetLabel); this.Invoke(dele); } else { this.label1.Text = "파일 복사 진행중"; } }
private void SetServLabel(string str) { if (this.labelAsyncServFileTrans.InvokeRequired) { SetLabelCallBack dele = new SetLabelCallBack(SetServLabel); if (this.IsHandleCreated) { this.Invoke(dele, new object[] { str }); } } else this.labelAsyncServFileTrans.Text = str; }