Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i want to change my form contains with clicking on a button like NEXT or PREVIEW . and so , i like change it after a time , for example when my programs runing after showing a movie as seccondes then menues and other buttons and icons appearance.

those were two questions.

and another question that , how can i playing a sound when users mouse overs the buttons and menues or icons .

if some projects exist like that , please give me thos link addresses or page adresses

and finally im so sorry for my veeery bad english :D
Posted
Comments
Sandesh M Patil 30-Jan-13 6:12am    
Hav you avr tri to implimennnt it wat you r sayying? Dont bottle abt my english now :P

Not able to understand ur requirement clearly... plz explain more properply.
and as far as u need to display sound on mouse over button

U cn write code on Button's Mouseover event

use name space
using using System.Media;


use below code to play sound(only .wav file)

C#
System.Media.SoundPlayer p = new SoundPlayer();
p.SoundLocation="filepath as string";
p.Play();



happy coding
enjoy :)
 
Share this answer
 
Comments
hor_313 1-Feb-13 8:52am    
hi dear

i put that code in my project and it worked . but i have another question about it.
if i want to put 2 musics in one event(like clicking on a button) and i want play music 1 at first and then music 2 starts to play.
how can i do it?

thanks
When you say c#, are you using WPF or Windows Forms.
Here is an example of achieving a 1 Window Program in WPF.

I have found that the best way to change a Windows container without calling new windows is to use a Usercontrol.

C#
<usercontrol horizontalalignment="Stretch" verticalalignment="Stretch" name="currentContent" usercontrol=""></usercontrol>


This way, you can easily change the content of the user control by changing the usercontrols content property.

WipView1 userControl = new WipView1();
currentContent.Content = userControl;


As for adding a sound to your buttons, The poster of Solution 1 is spot on!
 
Share this answer
 
Comments
hor_313 31-Jan-13 2:01am    
hi dear sry again for my language .

my mean was that , i want make a form that have some buttons such as NEXT button that when user clicking on it , the whole contents of form be change.

and i want make form in WindowsFormAplication

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900