2012-11-01 30 views

回答

0

你試過這個嗎?

WebKitBrowser webKitSharpBrowser = new WebKitBrowser(); 
webKitSharpBrowser.UseJavaScript = true; 
+0

「webKitBrowser1.UseJavaScript = true;」我已經檢查了API,默認情況下這個聲明是真實的:)但是仍然不能顯示警告框。你已經嘗試過了嗎? – Roylee

+0

@downvoter:祈禱爲什麼?我也想學習 – naveen

-2

您需要實施該方法。

 webKitBrowser.ShowJavaScriptAlertPanel += new ShowJavaScriptAlertPanelEventHandler(delegate(object o, ShowJavaScriptAlertPanelEventArgs e) { 
      MessageBox.Show(e.Message); 
     }); 
     webKitBrowser.ShowJavaScriptConfirmPanel += new ShowJavaScriptConfirmPanelEventHandler(delegate(object o, ShowJavaScriptConfirmPanelEventArgs e) { 
      e.ReturnValue = MessageBox.Show(e.Message, "", MessageBoxButtons.OKCancel) == DialogResult.OK; 
     }); 
+1

這並沒有真正回答這個問題。如果您有不同的問題,可以通過單擊[提問](http://stackoverflow.com/questions/ask)來提問。您還可以[添加賞金](http://stackoverflow.com/help/privileges/set-bounties)在您擁有足夠的[聲譽](http://stackoverflow.com/help/)時吸引更多人關注此問題什麼聲譽)。 –

相關問題