Textbox Keydown event not firing when arrow key press

前端 未结 3 755
执念已碎
执念已碎 2020-12-30 04:26

I have a datagrid with one column as DataGridTemplateColumn as follows :



        
相关标签:
3条回答
  • 2020-12-30 04:48

    I was facing the issue and PreviewKeyDown was also not capturing the arrow and Tab keys. I was launching my WPF window from WinForms. this post helped me. To be precise this exact line: ElementHost.EnableModelessKeyboardInterop(myWindow);

    0 讨论(0)
  • 2020-12-30 04:49

    Instead of that Use PreviewKeyDown

    0 讨论(0)
  • 2020-12-30 04:53

    The KeyDown event is not raised for navigational keys that would normally be handled by WPF, but the PreviewKeyDown event is. You should set Handled=True if you don't want WPF to also handle the key event.

    0 讨论(0)
提交回复
热议问题