PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms MessageBox sounds behaving strangely

Reply

MessageBox sounds behaving strangely

 
Thread Tools Rate Thread
Old 20-06-2008, 05:05 PM   #1
Barry Gilbert
Guest
 
Posts: n/a
Default MessageBox sounds behaving strangely


I understand that the MessageBox icon enumeration values map to system
sounds. This seems to be fairly predictable, even if the mapping sometimes
don't make sense. However, I've found a scenario in which it doesn't behave
correctly.

In a textbox's Validating event, when I call a MessageBox.Show, the first
time it plays the System's Default sound, no matter which icon value I
choose. Subsequent calls use the correct sound:

Private Sub MyTextBox_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) _
Handles MyTextBox.Validating
MessageBox.Show("This is an error","Error",, MessageBoxButtons.OK,
MessageBoxIcon.Error) ' This plays the system's Default sound
MessageBox.Show("This is an error","Error",, MessageBoxButtons.OK,
MessageBoxIcon.Error) ' This plays the system's Critial Stop sound
End Sub

Even if I change the first MessageBox's icon to MessageBoxIcon.None, it
still plays the Default sound. It only seems to do this in this event. When I
paste the same code into a button click handler, it behaves as expected.

Is this a bug in the messagebox?
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off