Webpage in dashboard

I’m sure there’s a better way to code this but this is how I got something working.

I didn’t find an event handler for the CustomWebBrowserDialog, but there’s the windows form handler FormClosed.

Try this:

    private void LaunchURL(string url, string title = "", int padding = 65)
    {
        Ice.Lib.Customization.CustomWebBrowserDialog uiWebBrowser = new Ice.Lib.Customization.CustomWebBrowserDialog();
        Ice.Lib.Framework.EpiBaseForm f = (Ice.Lib.Framework.EpiBaseForm)csm.PersonalizeCustomizeManager.TopControl.FindForm();
        uiWebBrowser.Width = f.Width - padding;
        uiWebBrowser.Height = f.Height - padding;
        uiWebBrowser.Text = title;
        uiWebBrowser.HomeURL = url;
        uiWebBrowser.StartPosition = FormStartPosition.CenterScreen; // If you don't center you can use .Top and .Left
        uiWebBrowser.Show();
        uiWebBrowser.OnRefresh(); // Loads URL

        // This is what probably should be moved somewhere else.
        uiWebBrowser.FormClosed += UiWebBrowser_FormClosed;
    }

    private void UiWebBrowser_FormClosed(object sender, FormClosedEventArgs e)
    {
        MessageBox.Show("web browser closed");
    }