views:

29

answers:

1

Hi

I have created an internet explorer toolbar using C#. On clicking on that toolbar button , I want to open internet explorer popup window. I have used web browser control with in the form and its invoke script method. With in the java script I have used window.open method to open the new window popup. I need to identify whether the popup is closed or not with in the form?.

+1  A: 

Since this is from within a Windows application, you might find it easier to create a separate form with its own (visible) WebBrowser control, with its Url property set to whatever address you were using in the javascript window.open method.

Here is a simple example of how to do this from a button's click event:

private void button1_Click(object sender, EventArgs e)
{
    Form f = new Form();
    WebBrowser wb = new WebBrowser();
    wb.Url = new Uri(@"http://www.stackoverflow.com");
    wb.Dock = DockStyle.Fill;
    f.Controls.Add(wb);
    f.FormClosed += f_FormClosed;
    f.Show();
}

void f_FormClosed(object sender, FormClosedEventArgs e)
{
    MessageBox.Show("popup has closed");
}
MusiGenesis
Thank you MusiGenesis, but i need to open a popoup of internet explore, not in webBrowser. what i have done is i, just added sone html nd js code to the webBrower document text nd opened the popup of ie, bt wt my problem is i cant access the status of this popup created in my application
raki