开发者

how to define short key for scroll in form in c#

how to define short key for scroll i开发者_JS百科n form in c#


The default keys for scrolling are the arrows.

If you want to redefine them with new keys, you can override your control's ProcessCmdKey method and use the arrows when the user clicks on the new keys:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData) 
{
    if (keyData == Keys.F)
        return base.ProcessCmdKey(ref msg, Keys.Up);
    else if (keyData == Keys.G)
        return base.ProcessCmdKey(ref msg, Keys.Down);

    return base.ProcessCmdKey(ref msg, keyData);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜