User-893317190 posted
Hi kafsar,
I'm not clear about what effect you want to have through sending [ENTER] to Textbox.
Do you mean you want to call some method or want to trigger some event?
SendKeys.Send("{ENTER}") seems to be a winform method, and it could simulate keyboard entering. If you want to realize the same effect, you had better use javascript.
javascript has an event named onkeydown,the event will be triggered when the user presses the keyboard.
In the event you could get what Keyboard button is being pressed.
For example, you could write your js as follows:
function whenInputEnter() {
alert("enter");
}
document.getElementById("TextBox1").onkeydown = function (e) {
if (e.keyCode == 13) {
whenInputEnter();
}
}
e.keyCode could represent the keyCode of your keyboard button. 13 is the keyCode of enter.
You could also directly call the function whenInputEnter like whenInputEnter();
Best regards,
Ackerly Xu