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

后端 未结 7 2056
悲哀的现实
悲哀的现实 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:52

        protected override bool ProcessDialogKey(Keys keyData)
        {
            System.Diagnostics.Debug.WriteLine(keyData.ToString());
    
            switch (keyData)
            {
                case Keys.Enter:
                    SendKeys.Send("{TAB}");
                    break;
            }
            base.ProcessDialogKey(keyData);
            return false;
        }
    

提交回复
热议问题