|
-
August 20th, 2009, 06:21 PM
#1
[RESOLVED] KeyEvents
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?
-
August 20th, 2009, 08:17 PM
#2
Re: KeyEvents
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?
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
August 20th, 2009, 09:05 PM
#3
Re: KeyEvents
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.
-
August 20th, 2009, 09:33 PM
#4
Re: KeyEvents
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...
Last edited by rliq; August 20th, 2009 at 09:39 PM.
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
August 20th, 2009, 09:37 PM
#5
Re: KeyEvents
Changed my app to display another windows form. This new form contains one button that is associated with the CancelButton property of the form.
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
}
Now it works perfectly in both cases, without sound. So it seems as though the standard message box makes a noise.
Can you post your menu handler code....
Last edited by rliq; August 20th, 2009 at 09:41 PM.
Rob
-
Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......
-
August 21st, 2009, 12:00 AM
#6
Re: KeyEvents
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|