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.
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
I want to disable the sound in the current form only, can this be done? if so how ?
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:
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
Copyright Information
Copyright © Codenstuff.com 2020 - 2023