Register an Event

If an event is not registered, you can register it by the following ways.

The first way, you can register it in textBox1's Properties, just as shown below.

 

The second way, you can register it in "Form1_Load", just like the code as follows.

private void Form1_Load(object sender, EventArgs e)
{
    textBox1.KeyPress += textBox1_KeyPress;
}
posted @ 2018-11-02 16:36  Kyle0418  阅读(116)  评论(0编辑  收藏  举报