Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# MetroFramework TabControl add ImageList #119

Open
mohamedosama914 opened this issue Jun 29, 2019 · 0 comments
Open

C# MetroFramework TabControl add ImageList #119

mohamedosama914 opened this issue Jun 29, 2019 · 0 comments

Comments

@mohamedosama914
Copy link

// private ImageList myimg = new ImageList();
// int i = 0;

 // private Bitmap CloseImage;
 Image CloseImage;

public void FaviconCustom(object sender, EventArgs e)
{
           // browserTabControl.ImageList = myimg;
            browserTabControl.ImageList = myimg;
            favicon();
}

     public void favicon()
        {

            // favicon
            // How to change favicon when tab page changes in c# browser?
            //
            // https://stackoverflow.com/questions/45919131/how-to-change-favicon-when-tab-page-changes-in-c-sharp-browser
            //
            //


            WebClient wc = new WebClient();
            MemoryStream memorystream = new MemoryStream(wc.DownloadData("http://" + new Uri(getCurrentBrowser().Address.ToString()).Host + "/favicon.ico")); /// http:// /// getCurrentBrowser()
            Icon icon = new Icon(memorystream);
            string i = Convert.ToString(myimg.Images.Count);
            myimg.Images.Add(i, icon.ToBitmap());
            browserTabControl.ImageList = myimg;
            browserTabControl.SelectedTab.ImageIndex = myimg.Images.Count - 1; // - 1


            //             favicon();
            ChromiumWebBrowser ChromiumWebBrowser = browserTabControl.SelectedTab.Controls[0] as ChromiumWebBrowser;

        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant