【发布时间】:2009-11-12 09:07:40
【问题描述】:
我有一个事件被触发时这样做:
htmlView.DocumentText = contentArea.Text;
问题是这个事件被触发了很多,我得到那个烦人的 IE “点击噪音”。我已经看到了一个解决方案 HowTo Disable WebBrowser 'Click Sound' in your app only 和另一个,但我对 C Sharp 很陌生(只使用了几个小时),我不确定是什么:
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);
...意思是。我把那个代码放在哪里?抱歉,我是 C Sharp 和 Visual Studio 的菜鸟,希望新手能够理解的帮助。
谢谢!
【问题讨论】: