Is there a way to turn off the sound that the Messagebox plays when it is displayed in WP7?
There's no way to change this behaviour with the Silverlight MessageBox class. If, however, you use Guide.BeginShowMessageBox (from the XNA libraries) you can control whether sounds are played or not.
No, currently there is no way you can disable the sound that is triggered by the MessageBox
class. That is a feature tied to the system and unless the device is on mute, the sound will be played.
With XNA's async version you can do this, though (as mentioned by Matt):
Guide.BeginShowMessageBox("Title", "Text", new List<string>() { "OK" }, 0, MessageBoxIcon.None, new AsyncCallback(YourCallback), null);
Here, MessageBoxIcon
defines the sound and not the icon (which is nonexistent on Windows Phone for a MessageBox
).
Note: you need yo add a reference to Microsoft.Xna.Framework.GamerServices
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With