Tyler
Tyler

Reputation: 1049

Turn off default sound when displaying MessageBox in WP7

Is there a way to turn off the sound that the Messagebox plays when it is displayed in WP7?

Upvotes: 5

Views: 1731

Answers (2)

Den
Den

Reputation: 16826

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.

Upvotes: 1

Matt Lacey
Matt Lacey

Reputation: 65586

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.

Upvotes: 4

Related Questions