如何在按钮单击中放置警报音 [英] how to put alarm tone in button click

查看:80
本文介绍了如何在按钮单击中放置警报音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,请给出一些逐步解决此问题的方法.

Sir please give some step wise process to solve this problem.

推荐答案

在单击此按钮时尝试播放wav文件.
Try playing a wav file when this button is clicked on.


在点击事件中使用它:

Use this in click event:

SoundPlayer player = new SoundPlayer("file path here");
player.Play();



虽然,如果这是一个Web应用程序,则必须在单击按钮时将声音文件嵌入页面中.



Although, if this is a web application, you will have to embed the sound file in the page on the button click.


保持很简单:

Keep is simple:

System.ConsoleBeep(400, 40);



如果没有控制台,请不要担心-它仍然可以工作(适用于窗口应用程序或其他任何应用程序).

—SA



Don''t be afraid if there is no console — is will work anyway (for windowed application or anything else).

—SA


这篇关于如何在按钮单击中放置警报音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆