Created
April 26, 2012 08:20
-
-
Save masaru-b-cl/2497559 to your computer and use it in GitHub Desktop.
WinFormsにて、ファンクションキーの既定の動作を握りつぶす方法
This file contains 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.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
namespace WindowsFormsApplication1 | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void Form1_KeyDown(object sender, KeyEventArgs e) | |
{ | |
if (Keys.F1 <= e.KeyCode && e.KeyCode <= Keys.F12) | |
{ | |
this.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