protected override void WndProc( ref Message m )
{
const int WM_HOTKEY = 0x0312;
switch(m.Msg)
{
case WM_HOTKEY:
if (m.WParam.ToInt32() == 100) Cursor.Position = new Point(Cursor.Position.X+1,Cursor.Position.Y);//右移一个
if (m.WParam.ToInt32() == 101) Cursor.Position = new Point(Cursor.Position.X-1,Cursor.Position.Y);//左移一个
if (m.WParam.ToInt32() == 102) Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y-1);//上移一个
if (m.WParam.ToInt32() == 103) Cursor.Position = new Point(Cursor.Position.X,Cursor.Position.Y+1);//下移一个
' Clicking Button1 causes a message box to appear.
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Click here!")
End Sub
' Use the SendKeys.Send method to trigger the Button1 click event
' and display the message box.
Private Sub Form1_DoubleClick(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.DoubleClick
' Send the enter key; since the tab stop of Button1 is 0, this
' will trigger the click event.
SendKeys.Send("{ENTER}")
End Sub
[C#]
// Clicking Button1 causes a message box to appear.
private void Button1_Click(System.Object sender, System.EventArgs e)
{
MessageBox.Show("Click here!");
}
// Use the SendKeys.Send method to trigger the Button1 click event
// and display the message box.
private void Form1_DoubleClick(object sender, System.EventArgs e)
{
// Send the enter key; since the tab stop of Button1 is 0, this
// will trigger the click event.
SendKeys.Send("{ENTER}");
}