Sound - Did you know that a message box automatically plays a beep?
Updated by Tylah Kapa [SSW] 1 year ago. See history
123
A message box automatically provides this functionality so there is no need to manually put a beep right before a message box pops up.

✅ Figure: Good example - Windows message boxes plays a sound... which cannot be captured in screenshot form.
string message = "You did not enter a server name. Cancel this operation?";string caption = "No Server Name Specified";MessageBoxButtons buttons = MessageBoxButtons.YesNo;System.Media.SystemSounds.Beep.Play();DialogResult result = MessageBox.Show(this, message, caption, buttons);
❌ Figure: Figure: Bad example - The sound on the button is hardcoded in this code snippet
string message = "You did not enter a server name. Cancel this operation?";string caption = "No Server Name Specified";MessageBoxButtons buttons = MessageBoxButtons.YesNo;DialogResult result = MessageBox.Show(this, message, caption, buttons);
✅ Figure: Figure: Good example - The code is not present in this example as it is automatically done