Click here to Skip to main content
11,935,053 members (55,532 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Multimedia

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 Big Grin | :-D
Posted 30-Jan-13 0:03am
SChristmas 30-Jan-13 6:12am
Hav you avr tri to implimennnt it wat you r sayying? Dont bottle abt my english now :P
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

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

happy coding
enjoy Smile | :)
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?

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

<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!
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100