• 大小: 0.01M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: t  

资源简介

Global Hotkey 共用事件

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//using System.Runtime.InteropServices;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {


        public Form1()
        {
            InitializeComponent();
        }

        HotKey hotkey1 hotkey2 hotkey3 hotkey4 hotkey5;

        private void button1_Click(object sender EventArgs e)
        {
            hotkey1 = new HotKey(this.Handle Keys.F2 Keys.None); //註冊F2為熱鍵 如果不要組合鍵請傳Keys.None當參數
            hotkey1.OnHotkey += new HotKey.HotkeyEventHandler(hotkey1to4_OnHotkey); //hotkey1~4共用事件

            hotkey2 = new HotKey(this.Handle Keys.F2 Keys.Control); //註冊C

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-01-11 01:46  GlobalHotKey\
     目录           0  2010-01-11 01:46  GlobalHotKey\GlobalHotKey\
     文件        6835  2010-01-11 01:41  GlobalHotKey\GlobalHotKey\Form1.cs
     文件        2780  2010-01-11 01:41  GlobalHotKey\GlobalHotKey\Form1.Designer.cs
     文件        5814  2010-01-11 01:41  GlobalHotKey\GlobalHotKey\Form1.resx
     文件        3238  2010-01-11 01:46  GlobalHotKey\GlobalHotKey\GlobalHotKey.csproj
     文件         481  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Program.cs
     目录           0  2010-01-11 01:46  GlobalHotKey\GlobalHotKey\Properties\
     文件        1207  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Properties\AssemblyInfo.cs
     文件        2924  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Properties\Resources.Designer.cs
     文件        5612  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Properties\Resources.resx
     文件        1104  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Properties\Settings.Designer.cs
     文件         249  2010-01-10 14:16  GlobalHotKey\GlobalHotKey\Properties\Settings.settings
     文件         925  2010-01-11 01:46  GlobalHotKey\GlobalHotKey.sln
     文件        9216  2010-01-11 01:46  GlobalHotKey\GlobalHotKey.suo

评论

共有 条评论