I had a old windows form WebBrowser and I had:
public WebBrowser getCurrentWebBrowser()
{
return (WebBrowser)TabControl.SelectedTab.Controls[0];
}
I want to know how to do the same thing in WPF.
Thanks for any help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can hook the TabContols’ SelectionChanged event and then have code like this in the callback…
If you have a WebBrowser in more than one tab, you can name the TabItems and adapt your callback thusly…
The ‘AddedItems’ property of the SelectionChangedEventArgs is a list of objects that have been selected since the last time the event was fired. For a TabControl, AddedItems should normally have a length of 1, and the single element should be an instance of HeaderedContentControl (i.e., the TabItem).