简体   繁体   中英

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. I have kept keypreview =true for this form and handled 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. Please suggest how to make this work.

use form keydown and type the textbox you want to write

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

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.

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