开发者

Turn off default sound when displaying MessageBox in WP7

开发者 https://www.devze.com 2023-03-03 06:28 出处:网络
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, y

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消