ok i have ac# 2017 net net windows form frmFS the KeyPress, KeyDown or Keyup are not firing. I created a new project with select the events for keypress, keydown and keyup (put a messageboc.show("bla") in each function it works but my current project nothing. how can i trace the issue.
Let's assume you are using a text box for your KeyDown
, KeyUp
and KeyPress
events.
In visual studio in the designer select the text box (or control you are referring to).
Then in the properties pane, select the Events tab.
Then look for the KeyDown
, KeyPress
and KeyUp
events.
If the values next to the events are blank then the event in not linked to the control.
you can double click in the value column to generate the code for the event, or you can see if the event appears in the drop down (if it already exists).
in the code for the form the event method should be visible.
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
//code here..
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.