描述
I'd like if I could set the WPF WebBrowser control sounds in .NET Framework 3.5 SP1 Beta.
The 'click' sound that plays everytime a page is loaded actually forces me not to use it (because I use the WebBrowser control to load frequently changing content).
I know I can use the Registry to disable this sound, but, it disables this sound for all applications using this WebBrowser control. And that's quite bad.
It would be much easier if there was a Sounds property of something in the WebBrowser control...
建议
Thank you for your feedback. We are tracking this issue, and will consider the feature for a future release. 

If you're using a standalone application or a full-trust .xbap, one way to achieve the desired effect of disabling sound on the WebBrowser just for your app would be to use the setting, FEATURE_DISABLE_NAVIGATION_SOUNDS, in IE7 and higher:

using System.Runtime.InteropServices;

...

int feature = FEATURE_DISABLE_NAVIGATION_SOUNDS;

CoInternetSetFeatureEnabled(feature, SET_FEATURE_ON_PROCESS, true);

private const int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21;

private const int SET_FEATURE_ON_THREAD = 0x00000001;
private const int SET_FEATURE_ON_PROCESS = 0x00000002;
private const int SET_FEATURE_IN_REGISTRY = 0x00000004;
private const int SET_FEATURE_ON_THREAD_LOCALMACHINE = 0x00000008;
private const int SET_FEATURE_ON_THREAD_INTRANET = 0x00000010;
private const int SET_FEATURE_ON_THREAD_TRUSTED = 0x00000020;
private const int SET_FEATURE_ON_THREAD_INTERNET = 0x00000040;
private const int SET_FEATURE_ON_THREAD_RESTRICTED = 0x00000080;

...

[DllImport("urlmon.dll")]
[PreserveSig]
[return:MarshalAs(UnmanagedType.Error)]
static extern int CoInternetSetFeatureEnabled(
int FeatureEntry, 
[MarshalAs(UnmanagedType.U4)] int dwFlags,
bool fEnable);

Thank you, 
Windows Presentation Foundation Product Team
 由 Microsoft 在 2008/9/3 14:28 发送
Product Language
English

Version

.NET Framework 3.5 Service Pack 1 Beta
Operating System
Windows XP Professional
Operating System Language
English (US)
Problem Statement
I am not able to disable the sounds played by the WPF WebBrowser control.
Proposed Solution
It would be nice if there was a property that disables/enables the sounds.