How do I simulate a Tab key press when Return is pressed in a WPF application?

后端 未结 7 2045
悲哀的现实
悲哀的现实 2021-01-01 16:37

In a WPF application, i have a window that has a lot of fields. When the user uses the TAB key after filling each field, windows understands that it moves on to the next. Th

7条回答
  •  粉色の甜心
    2021-01-01 16:43

    I think you should use that to simulate TAB :

    SendKeys.Send("{TAB}");
    

    Instead of

    e.Key = Key.Tab
    

    Sources : http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send.aspx

提交回复
热议问题