Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / desktop / WinForms

Disable 'click' sound when accesing WebBrower control

4.80/5 (5 votes)
20 Dec 2011CPOL 2  
Public Sub DisableSound() Dim keyValue As String keyValue = %SystemRoot%Media If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then keyValue += Windows XP Start.wav ElseIf Environment.OSVersion.Version.Major = 6 Then ...
VB
Public Sub DisableSound()
    Dim keyValue As String
    keyValue = "%SystemRoot%\Media\"
    If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then
        keyValue += "Windows XP Start.wav"
    ElseIf Environment.OSVersion.Version.Major = 6 Then
        keyValue += "Windows Navigation Start.wav"
    Else
        Return
    End If
    Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(_
        "AppEvents\Schemes\Apps\Explorer\Navigating\.Current", True)
    key.SetValue(Nothing, "", Microsoft.Win32.RegistryValueKind.ExpandString)
End Sub

Public Sub EnableSound()
    Dim keyValue As String
    keyValue = "%SystemRoot%\Media\"
    If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor > 0 Then
        keyValue += "Windows XP Start.wav"
    ElseIf Environment.OSVersion.Version.Major = 6 Then
        keyValue += "Windows Navigation Start.wav"
    Else
        Return
    End If
    Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(_
            "AppEvents\Schemes\Apps\Explorer\Navigating\.Current", True)
    key.SetValue(Nothing, keyValue, Microsoft.Win32.RegistryValueKind.ExpandString)
End Sub

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)