Hi, i'm implementing some shortcut keys for a c# windows application, now whenever i press a shortcut key i hear background windows alert (beep) sounds, how can i avoid these beeps?
Printable View
Hi, i'm implementing some shortcut keys for a c# windows application, now whenever i press a shortcut key i hear background windows alert (beep) sounds, how can i avoid these beeps?
Is your application already doiong something (busy) when you press the shortcut key?
Does the code you associate with the shortcut key (ie the Event Handler) get executed?
i'm making a windows.forms.form diag to appear whenever i press the shortcut key. for the first it works fine but when i press the key for the second time, the form diag appears with beep noise. when i use the mouse controls (context menu) to work with it then all everything goes well.
I just created a windows forms app. Created a context menu with one item on it "ShowDlg ctrl+s". Assigned the context menu to the form. Added a handler to the menu item to do a MessageBox.Show("Hello").
Right click on the form with the mouse choose the menu option, the MessageBox appears with a beep.
Close the MessageBox. Type ctrl+s and the message box appears with a beep.
Seems both, in my case, beep. Not sure if this is because I am using the standard MessageBox and not my own dialog...
Changed my app to display another windows form. This new form contains one button that is associated with the CancelButton property of the form.
Now it works perfectly in both cases, without sound. So it seems as though the standard message box makes a noise.Code:private void showDlgToolStripMenuItem_Click(object sender, EventArgs e)
{
Dlg d = new Dlg(); // Dlg is the name of the class of my new form
d.ShowDialog(); // not d.Show() as this prevent the button from closing the form
}
Can you post your menu handler code....
I've just figured that i was using the keyDown event on a docked ListView Control which needs to be linked with the main form. so when i was pressing a key it goes looking for that character in the list and returns a beep if it wasn't present in list.