Hello! I created a class inherited from the TextBox class. In the OnKeyPress method I try to get the selected text, but the SelectionLength and SelectionStart attributes are always 0.
private void OnKeyPress(object sender, KeyPressEventArgs e)
var index = this.SelectionStart;
var length = this.SelectionLength;
Сan you please tell me i am doing something wrong.
On the client side you can use:
this.getTextSelectionStart(); this.getTextSelectionEnd(); this.getTextSelectionLength(); this.getTextSelection(); this.setTextSelection(start, end); this.clearTextSelection(); this.selectAllText();
Please login first to submit.