/// <summary> /// Sets the Text of a label /// </summary> /// <param name = "label"></param> private void SetText(MPTLabel label, string text) { if (InvokeRequired) { ThreadSafeSetText d = SetText; Invoke(d, new object[] { label, text }); return; } label.Text = text; }
/// <summary> /// User clicked on a parameter label. Update combo box with value. /// </summary> /// <param name = "sender"></param> /// <param name = "e"></param> private void lblParm_Click(object sender, EventArgs e) { MPTLabel label = (MPTLabel)sender; int cursorPos = cbFormat.SelectionStart; string text = cbFormat.Text; string parameter = Util.LabelToParameter(label.Name); if (parameter != String.Empty) { text = text.Insert(cursorPos, parameter); cbFormat.Text = text; cbFormat.SelectionStart = cursorPos + 3; } }