简体   繁体   English

在 Enter 键上按 processTabkey() 不起作用

[英]On Enter key press processTabkey() not working

I have a form which navigates records through prev and next buttons.我有一个通过上一个和下一个按钮导航记录的表单。 We can add a new entry by clicking new button.我们可以通过单击新建按钮来添加新条目。 Prev,Next and new all are redirected to same form, prev and next populates form whereas new keep all entries empty and we can enter data. Prev、Next 和 new 都被重定向到同一个表单,prev 和 next 填充表单,而 new 保持所有条目为空,我们可以输入数据。 I have kept keypreview =true for this form and handled keydown().我为这个表单保留了 keypreview =true 并处理了 keydown()。

        if (e.KeyCode == Keys.Enter)
        {
             ProcessTabKey(true);
        }

It works for prev and next key navigated form.它适用于上一个和下一个键导航表单。 But on pressing new and trying to press enter, its not working.但是在按 new 并尝试按 enter 时,它不起作用。 Please suggest how to make this work.请建议如何使这项工作。

use form keydown and type the textbox you want to write使用表单 keydown 并输入您要编写的文本框

Form_KeyDown(object sender, KeyEventArgs e) if (e.KeyCode == Keys.Enter) { ProcessTabKey(true); console.write(e.Key) }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM