例如,我的应用程序贴到桌面的边缘时,如果它贴到右侧,如果鼠标光标在右侧下方100个像素,气球提示将指向错误的位置。但是,如果鼠标光标在其他任何地方,它将指向正确的位置。
在这种情况下,我希望伪造鼠标光标位置(而不实际更改鼠标光标位置)到其他位置,以便问题不会发生。
这是否可行?我该如何实现?
private void noteTitleInput_KeyPress(object sender, KeyPressEventArgs e) {
if(e.KeyChar == Convert.ToChar(Keys.Return, CultureInfo.InvariantCulture) && noteTitleInput.Text.Length > 0) {
e.Handled = true;
noteInputButton_Click(null, null);
} else if(!Char.IsControl(e.KeyChar)) {
if(Array.IndexOf(Path.GetInvalidFileNameChars(), e.KeyChar) > -1) {
e.Handled = true;
System.Media.SystemSounds.Beep.Play();
noteTitleToolTip.Show("The following characters are not valid:\n\\ / : * ? < > |",
groupNoteInput, 25, -75, 2500);
return;
}
}
noteTitleToolTip.Hide(groupNoteInput);
}