/// <summary> /// Add a caption /// </summary> /// <param name="text"></param> public void InitInput(string text, GotInputEventHandler handler) { CaptionText = text; var splits = tbInput.Text.Split(':'); if (splits[0] + ":" == text) { if (splits[1] == string.Empty) { return; } tbInput.GoEnd(); while (tbInput.Selection.CharBeforeStart != ':') { tbInput.Selection.GoLeft(true); } return; } tbInput.Text = text; tbInput.GoEnd(); tbInput.Range.ClearStyle(); tbInput.Range.ClearStyle(ReadOnlyStyle, LabelStyle); tbInput.Range.SetStyle(ReadOnlyStyle, @"\b.*:"); tbInput.Range.SetStyle(LabelStyle, @"\b.*:"); this.GotInput = null; GotInput = handler; }
/// <summary> /// Add a caption /// </summary> /// <param name="text"></param> public void InitInput(string text, GotInputEventHandler handler) { CaptionText = text; var splits = tbInput.Text.Split(':'); if (splits[0] + ":" == text) { if (splits[1] == string.Empty) return; tbInput.GoEnd(); while (tbInput.Selection.CharBeforeStart != ':') tbInput.Selection.GoLeft(true); return; } tbInput.Text = text; tbInput.GoEnd(); tbInput.Range.ClearStyle(); tbInput.Range.ClearStyle(ReadOnlyStyle,LabelStyle); tbInput.Range.SetStyle(ReadOnlyStyle, @"\b.*:"); tbInput.Range.SetStyle(LabelStyle, @"\b.*:"); this.GotInput = null; GotInput = handler; }