MessageBoxIcon.Question播放声音?

时间:2014-04-25 22:45:33

标签: c# messagebox audio

我想在显示留言箱问题类型时播放声音。

这是我的代码:

if (MessageBox.Show("Do you really want to delete this item?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

当弹出消息框时,没有声音..

谢谢,

2 个答案:

答案 0 :(得分:1)

这是基于控制面板中用户的系统设置。如果用户没有与问题事件相关联的声音,则不会播放任何内容。

答案 1 :(得分:0)

My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Hand)
if (MessageBox.Show("Do you really want to delete this item?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)