当我按下PgDown键时如何切换(移动)到下一个窗体,而当我按下PgUp键时又如何移动到上一个窗体, [英] how can i switch(move) to the next form when i press the PgDown key and move to the previous form when i press the PgUp key,

查看:286
本文介绍了当我按下PgDown键时如何切换(移动)到下一个窗体,而当我按下PgUp键时又如何移动到上一个窗体,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我按下PgDown键时如何切换(移动)到下一个窗体,而当我按下PgUp键时又如何移动到上一个窗体,

请任何人帮我给我简单的代码行,"、、、、、、、,这非常紧急...

how can i switch(move) to the next form when i press the PgDown key and move to the previous form when i press the PgUp key,

Plese anyone help me for giving me a simple line of code ,,,,,,,,,it''s very urgent...

推荐答案

您看到了什么强调紧迫性对您有帮助吗?
它使您等待更长的时间.

这可能对您很紧急,但对我们而言并非如此.您所强调的紧迫性只是使我们认为您离开得太晚了,并希望我们为您做这件事.这使某些人烦恼,并且可能会减慢响应速度.

那么,您又遇到了什么问题?

哦,是的,我记得.

处理表单KeyDown事件:
You see what stressing the urgency does for you?
It makes you wait longer.

It may be urgent to you, but it isn''t to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.

So, what was your problem again?

Oh yes, I remember.

Handle the Form KeyDown event:
private void frmMain_KeyDown( object sender, KeyEventArgs e )
    {
    if (e.KeyCode == Keys.PageDown)
        {
        frmUpdate.Focus();
        }
    }

您需要将要切换到的表单实例传递给每个子表单.

您可能会发现必须为两种形式的每个控件都设置KeyDown事件处理程序,以便可以接收任何形式的用户输入:否则它将不起作用,因为它们会吞噬"击键.但是,它们都可以由相同的事件处理程序方法处理.

You will need to pass through to each sub form the instance of the form it is to switch to.

You will probably find that you have to set the KeyDown event handler for each control on both forms which can receive any form of user input: or it won''t work as they will "swallow" the keystroke. They can all be handled by the same event handler method, however.


这篇关于当我按下PgDown键时如何切换(移动)到下一个窗体,而当我按下PgUp键时又如何移动到上一个窗体,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆