Disable sound in form

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Disable sound in form
AnoPem
I want to disable the sound in the current form only, can this be done? if so how ?
https://t.me/pump_upp
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Disable sound in form
mandai
If you are using Vista or later then the volume is already set per application.

You can adjust the volume with waveOutSetVolume. This sample might be useful:
Code: Select all
    <DllImport("winmm.dll")> Shared Function waveOutSetVolume(ByVal hwo As IntPtr, ByVal pdwVolume As UInteger) As UInteger
    End Function

    Private Sub btnMute_Click(sender As System.Object, e As System.EventArgs) Handles btnMute.Click

        waveOutSetVolume(IntPtr.Zero, 0)
    End Sub
2 posts Page 1 of 1
Return to “Coding Help & Support”