Search code examples
c#volumemousewheelwmp

How to change the volume by using mouse wheel?


I am new and know little about this. I am using WMPLib namespace.

I tried figuring out how to change the volume by using the mouse wheel:

void Form1_MouseWheel(object sender, MouseEventArgs e)
{
    wmpPlayer.settings.volume = //inc or dec
}

How do I do this?


Solution

  • Thanks for the answers...

    I finally got it:

        void Form1_MouseWheel(object sender, MouseEventArgs e)
        {
            if(e.Delta > 0)
                wmpPlayer.settings.volume = activeMusic.settings.volume + 1;
            else
                wmpPlayer.settings.volume = activeMusic.settings.volume - 1;
    
            //to check the volume no.
            MessageBox.Show(Convert.ToString(wmpPlayer.settings.volume));
        }