oclockvn
4/19/2015 - 8:23 AM

multi_tab_get_current_browser.cs

WebBrowser GetCurrentBrowser()
{
    var selectedTab = Tabs.SelectedTab;
    if (selectedTab == null)
        return null;

    var browserName = "browser_" + selectedTab.Tag;

    if (selectedTab.Controls.ContainsKey(browserName))
    {
        return (WebBrowser)selectedTab.Controls[browserName];
    }

    return null;
}