Hello Again,
>> To be clear, are you trying to have multiple child windows of a single parent, all with the same name "REPORT_FORM" ?
- Yes that is exactly what i wanted but without the target name must be same.
For example, i have a report page and there are 5 link to open report detail page. Whenever i click any link it opens new windows with name as "REPORT_FORM" . OnBeforePopup fires and i make it child form and popup form.
After that i have parent form and child form which comes from parent. I come back to main form and click another report form link and then OnBeforePopup doesn't fire because of i made it child. If i didn't make it child and popup, the event would be fired. when i click that link "OnBeforePupup" doesn't fire but the link opens on the child form. so i still have one child form. If i don't make them child, the event would be fired and i would open new popup form.
In Scenario that i make it child, i can have only one popup form and all javascript codes between parent and child will be worked.
In Scenario that i don't make it child, i can have more than one popup form but javascript codes won't be worked.
That i want is have more than one popup forms evet targetname was same and at the same time i want all javascript codes between parent and its childiren working
In this situation, if i can, change the targetname as different for each. What event can i change it in ?
Note: I can't change web pages contents.
the following code is i use in OnBeforePopup
public bool OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName,
WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings,
ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
var chromiumWebBrowser = (ChromiumWebBrowser)browserControl;
ChromiumWebBrowser chromiumBrowser = null;
var windowX = windowInfo.X;
var windowY = windowInfo.Y;
var windowWidth = (windowInfo.Width == int.MinValue) ? 600 : windowInfo.Width;
var windowHeight = (windowInfo.Height == int.MinValue) ? 800 : windowInfo.Height;
chromiumWebBrowser.Invoke(new Action(() =>
{
var owner = chromiumWebBrowser.FindForm();
chromiumBrowser = new ChromiumWebBrowser(targetUrl)
{
LifeSpanHandler = this
};
chromiumBrowser.SetAsPopup();
chromiumBrowser.CreateControl();
var popup = new BrowserForm
{
Left = windowX,
Top = windowY,
Width = windowWidth,
Height = windowHeight
};
popup.Adjust(targetUrl, chromiumBrowser); // Navigate to new Url and show form.
var rect = chromiumBrowser.ClientRectangle;
windowInfo.SetAsChild(chromiumBrowser.Handle, rect.Left, rect.Top, rect.Right, rect.Bottom);
}));
newBrowser = chromiumBrowser;
return false;
}