using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace Sound
{
public partial class Sound : UserControl
{
System.Media.SoundPlayer player = new SoundPlayer(Properties.Resources.ALARM8);
private bool hasSound;
private bool ring;
public bool Ring
{
get { return ring; }
set
{
ring = value;
if (ring)
{
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
pictureBox1.Image = Properties.Resources.Sound;
player.Dispose();
player = new SoundPlayer(Properties.Resources.ALARM8);
player.LoadAsync();
player.PlayLooping();
}
else
C#下写的一个报警控件
最新推荐文章于 2024-06-20 08:45:13 发布