Click here to Skip to main content
15,909,437 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to clear FileSystemWatcher.Path ? [modified] Pin
Johnny J.19-May-10 22:39
professionalJohnny J.19-May-10 22:39 
GeneralMessage Removed Pin
20-May-10 14:33
EthicsGradient20-May-10 14:33 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.20-May-10 19:55
professionalJohnny J.20-May-10 19:55 
GeneralMessage Removed Pin
21-May-10 3:34
EthicsGradient21-May-10 3:34 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Johnny J.21-May-10 3:38
professionalJohnny J.21-May-10 3:38 
GeneralMessage Removed Pin
21-May-10 13:58
EthicsGradient21-May-10 13:58 
GeneralRe: How to clear FileSystemWatcher.Path ? Pin
Pete O'Hanlon23-May-10 9:11
mvePete O'Hanlon23-May-10 9:11 
QuestionWM_PAINT makes textbox non-unicode Pin
thomus0719-May-10 18:27
thomus0719-May-10 18:27 
AnswerRe: WM_PAINT makes textbox non-unicode Pin
thomus0719-May-10 18:53
thomus0719-May-10 18:53 
QuestionI Find This Baffling Pin
Roger Wright19-May-10 18:16
professionalRoger Wright19-May-10 18:16 
AnswerRe: I Find This Baffling Pin
Luc Pattyn19-May-10 18:42
sitebuilderLuc Pattyn19-May-10 18:42 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 3:00
professionalRoger Wright20-May-10 3:00 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 3:34
sitebuilderLuc Pattyn20-May-10 3:34 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 5:11
professionalRoger Wright20-May-10 5:11 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 5:20
sitebuilderLuc Pattyn20-May-10 5:20 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:10
professionalRoger Wright20-May-10 16:10 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 16:29
sitebuilderLuc Pattyn20-May-10 16:29 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:51
professionalRoger Wright20-May-10 16:51 
GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 17:12
sitebuilderLuc Pattyn20-May-10 17:12 
So I investigated your "bonk". Seems like all TextBoxes will do that by default, when present on some forms, probably all modeless forms, such as your main form.

What you are hearing most likely is a "beep" (at a high volume level). It is one of the Windows signals (a virtual sound), which by default probably causes "Ding.wav" to be played.

You could tell your PC to never do that (through the "Sound" control panel); a bad idea.
You could modify your app and have the TextBoxes swallow the unwanted characters (there probably are a lot of them, try ESC!)

The remedy is to add a KeyDown handler (and wire it up to the textbox) that decides which characters to process or not to process, something like:
// swallow ENTER
private void aTextBox_KeyDown(object sender, KeyEventArgs e) {
	Keys k=e.KeyCode;
	if (k==Keys.Enter) {
		e.Handled=true;
		e.SuppressKeyPress=true;
	}
}


Of course you noticed that this little filter did not refer a specific TextBox, so it could be wired up to a lot of TextBoxes.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: I Find This Baffling Pin
Luc Pattyn20-May-10 18:08
sitebuilderLuc Pattyn20-May-10 18:08 
GeneralRe: I Find This Baffling Pin
dybs21-May-10 18:35
dybs21-May-10 18:35 
AnswerRe: I Find This Baffling Pin
dybs19-May-10 18:44
dybs19-May-10 18:44 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 3:02
professionalRoger Wright20-May-10 3:02 
GeneralRe: I Find This Baffling Pin
Roger Wright20-May-10 16:17
professionalRoger Wright20-May-10 16:17 
QuestionHttpWebRequest simultaneously!!!! Pin
Christian_V_V19-May-10 18:05
Christian_V_V19-May-10 18:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.