// Its called from my main form in the following code
BetaScreen form = new BetaScreen(wbCache);
form.ShowDialog();
form.Dispose();
// through here
public partial class BetaScreen : Form // this is where I want to display
{
public BetaScreen(WebBrowser browser)
{
InitializeComponent();
wbMain = browser;
wbMain.PerformLayout(); // just tried something to make it work
}
}
What I want to do is, I have a webbrowser
navigate to a page, say stackoverflow.com. I can see the website pictures etc in my webbrowser
which is in my main form. I want to do something like popup to show this webbrowser in pop up (BetaScreen). But I can't do it, it just shows me a blank white webbrowser in 2nd form (BetaScreen).
CODE UPDATE:
object cache;
public BetaScreen(object browser)
{
InitializeComponent();
cache = browser;
}
private void BetaScreen_Load(object sender, EventArgs e)
{
WebBrowser browser = (WebBrowser)cache;
browser.Dock = DockStyle.Fill;
this.Controls.Add(browser);
}
I got it work with passing
`ShowDialog((object)wbCache);
but this time it goes off from my main form =D