HowTo Disable WebBrowser 'Click Sound' in your app only

前端 未结 5 529
南旧
南旧 2020-12-05 17:52

The \'click sound\' in question is actually a system wide preference, so I only want it to be disabled when my application has focus and then re-enable when the application

5条回答
  •  情歌与酒
    2020-12-05 18:26

    I've noticed that if you use WebBrowser.Document.Write rather than WebBrowser.DocumentText then the click sound doesn't happen.

    So instead of this:

    webBrowser1.DocumentText = "

    Hello, world!

    ";

    try this:

    webBrowser1.Document.OpenNew(true);
    webBrowser1.Document.Write("

    Hello, world!

    ");

提交回复
热议问题