Created
April 26, 2012 08:41
-
-
Save masaru-b-cl/2497694 to your computer and use it in GitHub Desktop.
こうですか?わかりません><
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.ComponentModel; | |
using System.Windows.Forms; | |
namespace WindowsFormsApplication1 | |
{ | |
class FunctionKeyPressComponent : Component | |
{ | |
private Form target; | |
public Form Target | |
{ | |
get { return target; } | |
set { | |
target = value; | |
if (target == null) return; | |
target.KeyDown += (s, e) => | |
{ | |
if (Keys.F1 <= e.KeyCode && e.KeyCode <= Keys.F12) | |
{ | |
target.Text = e.KeyCode.ToString() + " Pressed!"; | |
// ファンクションキーの基底の動作を握り潰す | |
e.Handled = true; | |
} | |
}; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
こうだと思います。