Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:22:25+00:00 2026-06-03T10:22:25+00:00

I have a slider and a webbrowser object in my form and sliding it

  • 0

I have a slider and a webbrowser object in my form and sliding it should change the volume, however it does move the slider as seen here: Slider does move, but sound output doesn't change

but it doesn’t change the volume’s actual output. This is probably because I integrated the WebBrowser object and using Windows 7. When I manually slide the slider (the one seen in the screenshot) the volume output does change. When playing a .wav file the volume’s output does change, but not with the WebBrowser object.

I’m using the following code:

Xaml

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Slider Minimum="0" Maximum="10" ValueChanged="ValueChanged"/>
    </Grid>
</Window>

C#

public partial class MainWindow
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
    {
        // Calculate the volume that's being set
        double newVolume = ushort.MaxValue * e.NewValue / 10.0;

        uint v = ((uint) newVolume) & 0xffff;
        uint vAll = v | (v << 16);

        // Set the volume
        int retVal = NativeMethods.WaveOutSetVolume(IntPtr.Zero, vAll);

        Debug.WriteLine(retVal);
    }
}

static class NativeMethods
{
    [DllImport("winmm.dll", EntryPoint = "waveOutSetVolume")]
    public static extern int WaveOutSetVolume(IntPtr hwo, uint dwVolume);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:22:30+00:00Added an answer on June 3, 2026 at 10:22 am

    Try using a MediaElement.

    Then you could play your radio station like this:

    <MediaElement LoadedBehavior="Manual" x:Name="media" />
    
    media.Source = new Uri(@"http://shoutcastinfo.radiostaddenhaag.com/stad.wax");
    media.Play();
    

    And change the volume with

    <Slider Minimum="0" Maximum="1" ValueChanged="ValueChanged"/>
    
    private void ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
    {
        media.Volume = e.NewValue;
    }
    

    Both the Windows Mixer and the WPF slider now change the volume appropriately, but the values of the two are independent and don’t reflect each other’s’ changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an slider animation but on clX.click event #close div hides before it
I have a slider I've made, the slider part works correctly, but I'm trying
In my View I have a slider and a combobox . When I change
I have a StackPanel inside of a ScrollViewer. I have a slider that does
I have created a volume controller for iTunes but I would like this app
I have some code that does custom drawing. Basically it is form fill program
I have a slider, which responds to hash tag changes to move to the
i have a slider that scrolls on drag using the jquery UI however the
I have this slider on my website: http://css-tricks.com/examples/AnythingSlider/ It works fine, but I don't
I have Slider,which works perfect. But what i am trying to do is, for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.