protected override void OnTextInput(TextCompositionEventArgs e) { string text = this.Text; this.Text = text.Substring(0, this.caretIndex) + e.Text + text.Substring(this.caretIndex); ++this.CaretIndex; e.Handled = true; }
protected virtual void OnTextInput(TextCompositionEventArgs e) { }