2014-10-03 30 views

回答

0

我假設由how to call a function你正在談論C#的方法呢?在這種情況下,你可以簡單地註冊到Navigated事件WebBrowser控制和調用函數時,被調用的方法:

<WebBrowser Navigated="WebBrowser_Navigated"></WebBrowser> 

而在後臺代碼:

private void WebBrowser_Navigated(object sender, NavigationEventArgs e) 
{ 
    // Call your function 
} 
0

您是否嘗試過的NavigatingNavigated事件?

XAML(WPF應用程序):

<WebBrowser Name="browser" Navigated="browser_Navigated" Navigating="browser_Navigating" /> 

C#(代碼後面):

// When navigation is done 
private void browser_Navigated(object sender, NavigationEventArgs e) 
{ 
    MessageBox.Show("Navigated"); 
} 

// When navigation starts 
private void browser_Navigating(object sender, NavigatingCancelEventArgs e) 
{ 
    MessageBox.Show("Navigating"); 
}