What code do I need to use to for background music?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Joseph VH
    New Member
    • Nov 2010
    • 1

    What code do I need to use to for background music?

    hello
    What code do I need to use on my Form to add background music and where do I put It.
    I think I have to put it in [public Form1()]

    Joseph
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Have a look here...



    It's in VB, but it should be roughly the same for C#. In VB, "Me" is the same as "this" :)

    Comment

    • Subin Ninan
      New Member
      • Sep 2010
      • 91

      #3
      You can use SoundPlayer class to play .wav files.
      Add this code in form_Load event.

      Code:
      System.Media.SoundPlayer sp = new System.Media.SoundPlayer("bkgrnd.wav");
      sp.Play();

      Comment

      Working...