Form1.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace BackgroundMusic_Demo
  10. {
  11. public partial class Form1 : Form
  12. {
  13. LYFZ.PlayMusicMedia.FormPlayMusic frm = new LYFZ.PlayMusicMedia.FormPlayMusic();
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. this.Load += Form1_Load;
  18. // frm = new LYFZ.PlayMusicMedia.FormPlayMusic();
  19. }
  20. void Form1_Load(object sender, EventArgs e)
  21. {
  22. }
  23. private void button1_Click(object sender, EventArgs e)
  24. {
  25. if (frm != null)
  26. {
  27. frm.Play();
  28. }
  29. }
  30. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  31. {
  32. frm.IsMuted = checkBox1.Checked;
  33. }
  34. private void trackBar2_Scroll(object sender, EventArgs e)
  35. {
  36. frm.SetMediaVol(trackBar2.Value);
  37. }
  38. private void button2_Click(object sender, EventArgs e)
  39. {
  40. frm.Stop();
  41. }
  42. private void button3_Click(object sender, EventArgs e)
  43. {
  44. frm.Pause();
  45. }
  46. }
  47. }