Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello everyone
i am creating a simple media player in wpf c# (visual studio 2013)and instead of slide bar i want to use increase and decrease (-,+)buttons for volume

so can anyone help me how i can do it through code

in my code my increase volume button is working
but my purpose is to remove slide bar and use three button for mute, increase and decrease volume

thank you

What I have tried:

private void Slider_vol_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            mediaPlayer.Volume = (double)slider_Vol.Value;
        }



private void volumeUPButton_Click(object sender, RoutedEventArgs e)
        {
            mediaPlayer.Volume += 0.01; 

        }

        private void volumeDownButton_Click(object sender, RoutedEventArgs e)
        {
            mediaPlayer.Volume -= 0.01;
        }
Posted
Updated 16-Sep-17 1:53am

1 solution

GOOGLE SEARCH is your friend: volume of media player in WPF C#[^]

Found this with C# source code and XAML: WPF - Custom design volume control - Stack Overflow[^]
 
Share this answer
 

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