473,325 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

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
Nov 2 '10 #1
2 10025
GaryTexmo
1,501 Expert 1GB
Have a look here...

http://www.codeproject.com/KB/vb/Pla...Bnet_with.aspx

It's in VB, but it should be roughly the same for C#. In VB, "Me" is the same as "this" :)
Nov 2 '10 #2
You can use SoundPlayer class to play .wav files.
Add this code in form_Load event.

Expand|Select|Wrap|Line Numbers
  1. System.Media.SoundPlayer sp = new System.Media.SoundPlayer("bkgrnd.wav");
  2. sp.Play();
  3.  
Nov 2 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Brett | last post by:
I'm developing with CF 5 and SQL Server 2000. I think they are both great products. The major draw is their cost. I don't develop stand alone products because anyone that wants to purchase them...
4
by: Doug van Vianen | last post by:
Hi, I am using Visual Basic 6 to generate web pages that can be used by the members of our seniors' computer club to create e-cards that include their own pictures. I wish to include background...
12
by: Fir3Bat | last post by:
C++ gets confusing sometimes just like my next problem I need to get a specific line in the file Say File Precipitation has this inside January 14.5 12.5 10.8 8.2 13.8
1
by: chillaks | last post by:
Hi, I have a flash website but the background music is not looping.It is a flash website but i dont have the source file of it. can any1 please help me to fix the bug?.. its quite urgent.....
0
by: paodzy | last post by:
how to import a sound that serve as a background music. please cite some example of codes.
3
by: paodzy | last post by:
how to import a background music in vb6.if the form is load then the music will start to play.can you please post the code for this.please help me....
10
by: andrew.smith.cpp | last post by:
Hello :-) how can i play a ".wav" file in C++.means with the help of the C++ code i just want to play a "a.wav" file more then 10 times. i just want to play background music. Can i do it in C++ ?...
2
by: ventsislav | last post by:
I want to have a background music to my simple app and a buton which plays another sound, but when I press the button the sound from it interrupts the background sound. I tried with SoundPlayer and...
0
by: yogarajan | last post by:
Hi friends i have one website it is background music playing continue i have schedule morning 6 AM to 8 Am Devotional songs 8 to 10 Michel jackson hits
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.