按F1键打开一个新表格 [英] press F1 key to open a new form

查看:45
本文介绍了按F1键打开一个新表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我已经为我的程序提供了帮助,我想按F1键运行帮助表格.
我该怎么办?
有人可以给我密码吗?

Hi I have provided a help for my program and i want to press F1 for running helps form.
what should I do?
could someone give me a code!
best regards.

推荐答案

private void Form1_Load(object sender, EventArgs e)
{
    this.KeyPreview = true;
    this.KeyDown += new KeyEventHandler(Form1_KeyDown);
}

void Form1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode.ToString() == "F1")
    {
        // the user pressed the F1 key
    }
}


处理表单中的KeyPress事件并检查F1并从那里获取帮助.
Handle the KeyPress event in your form and check for F1 and bring up your help from there.


这篇关于按F1键打开一个新表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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