Simulate the Backspace button in the program

zhaozj2021-02-16  54

Demand: In the WinForm application, you sometimes need a real-time check of the following requirements: When the user input does not allow the input, the program is automatically cleared, that is, faithful to the pressing backspace key implementation: in the text (! IsLegality): checksum in block textbox_TextChanged event private void textbox1_TextChanged (object sender, System.EventArgs e) {if // execute {textbox1.Focus () is not valid; SendKeys.Send ( "{backspace}") }}

转载请注明原文地址:https://www.9cbs.com/read-15642.html

New Post(0)