Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / Windows Forms
Alternative
Tip/Trick

Disable 'click' sound when accesing WebBrower control

Rate me:
Please Sign up or sign in to vote.
4.80/5 (5 votes)
20 Dec 2011CPOL 11.5K   2   1
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)


Written By
Brazil Brazil
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
Porcaminkia12-Sep-12 9:40
Porcaminkia12-Sep-12 9:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.