Winform suddenly does not respond to KeyEvent_PHP tutorial

WBOY
Release: 2016-07-12 08:58:14
Original
907 people have browsed it

Winform suddenly stopped responding to KeyEvent

In the beginning, WINFORM's KeyEvent was valid.

Winform suddenly does not respond to KeyEvent_PHP tutorial

After using some controls to set their MouseEvent, Winform suddenly stopped responding to KeyEvent! !

Winform suddenly does not respond to KeyEvent_PHP tutorial

You can solve it by following the steps below:


1. Try setting Form.KeyPreview to True first.

The function of KeyPreview is to determine whether the keyboard events of the controls on the form have been registered with the form. After I pressed the above settings, the Form's KeyEvent became alive again.


Winform suddenly does not respond to KeyEvent_PHP tutorial

If it still doesn’t work, press 2.


2. This function needs to be overloaded

protected override bool ProcessDialogKey(Keys keyData)



Reference:

http://m.myexception.cn /c-sharp/78949.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1104551.htmlTechArticleWinform suddenly does not respond to KeyEvent. At first, WINFORM's KeyEvent is valid. After using some controls to set their MouseEvent, Winform suddenly stopped responding to KeyEvent! ! You can follow the steps below...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!