Welcome to Dream.In.Code
Become a C# Expert!

Join 150,413 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 994 people online right now. Registration is fast and FREE... Join Now!




About My Play Sound Program!

 
Reply to this topicStart new topic

About My Play Sound Program!, this the code i made

THEROCK
20 Mar, 2008 - 06:25 AM
Post #1

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 4

this is the simple code >>>
CODE

using sysstem.IO;
private void buttom1_Click(objest sender , eventargs e)
{
filestream F= new filestream ("path",filemode.open);
new playsound.play(f);
}

User is offlineProfile CardPM
+Quote Post

zakary
RE: About My Play Sound Program!
20 Mar, 2008 - 06:27 AM
Post #2

D.I.C Regular
Group Icon

Joined: 15 Feb, 2005
Posts: 420



Thanked: 8 times
Dream Kudos: 175
My Contributions
ok whats up with it
User is offlineProfile CardPM
+Quote Post

THEROCK
RE: About My Play Sound Program!
20 Mar, 2008 - 06:38 AM
Post #3

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 4

i wanna make the file stop when i click another click on the same buttom

User is offlineProfile CardPM
+Quote Post

zakary
RE: About My Play Sound Program!
20 Mar, 2008 - 07:06 AM
Post #4

D.I.C Regular
Group Icon

Joined: 15 Feb, 2005
Posts: 420



Thanked: 8 times
Dream Kudos: 175
My Contributions
So add a stop button with the click handler event and make your filestream F a globe variable and in your stop button click event call F.Close();
User is offlineProfile CardPM
+Quote Post

THEROCK
RE: About My Play Sound Program!
22 Mar, 2008 - 12:10 AM
Post #5

New D.I.C Head
*

Joined: 4 Mar, 2008
Posts: 4

but if i click another click would it begin playing

and so what about pauseing buttom
User is offlineProfile CardPM
+Quote Post

zakary
RE: About My Play Sound Program!
25 Mar, 2008 - 04:07 AM
Post #6

D.I.C Regular
Group Icon

Joined: 15 Feb, 2005
Posts: 420



Thanked: 8 times
Dream Kudos: 175
My Contributions
you can use the same button you will just need to create an enum that holds the state of the button on each click. I would user several buttons and control it that way. not only is it easier on you but the user will find it easier and more user friendly.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 07:51PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month