This is most likely my misunderstanding of how Infragistics works, but I have the following scenario.
WinForm containing a dock manager and a mdi manager. This allows me to either dock or "fill" my panes in the form.
One pane contains a WebBrowserControl, inside which I am rendering a local web page (Bing maps.)
If the pane is a pane and docked anywhere, calling Close on it works without issue - the pane closes and can then be opened again with Show.
If the pane is a tab (Dockable false), calling Close on it is appearing to cause the WebBrowserControl to unload.
I have attached a sample of this behaviour, there is a debugger line in the javascript to show when the web page is being unloaded.
To use the sample
This all works fine to this point, the pin is still there and no errors are thrown
This is not the desired, nor expected behaviour - any advice on how to make this function as I was expecting would be much appreciated.
Thanks in advance!
(Edit) : I am away on annual leave until Nov 1st
One other thought so as not to confuse the situation, the same behaviour is shown when a different control is placed in the pane (for example a MapPoint map object.)
I added a label to the panel instead of the browser and set up the code so that I could use either the label or the browser in the panel. When I was using the label, I commented out all code associated with the browser in the ultraButtonPin_Click event. That is when I realized that was the source of the issue.
Then when using the browser, I realized that the first time you click on the Pin button, there was no issue running your code to add a new script to the head element. But on subsequent clicks of the Pin button the error occurs then you InvokeScript(“change”). I’m also not sure that you need to keep adding the same script repeatedly. In any case the the script error points you to this site concerning the map.
http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2
When I tested the sample with the label, I could open / close and of course Add Pin which only open the pane and tab, making them visible.
The MdiTab.close and the pane.close do not destroy the control, they hide the control. And the subsequent Show(), makes the control visible.
I’m not sure why the browser is eliminated when you close the mdiTab.
I’ll pass back the updated code so you can see where I am so far.
But I wanted to let you know what I see so far.
Thanks for your input Marianne.
Despite my dubious coding to demonstrate the issue, there is still a difference between the effect Close has on the Panes contents whether it is an MDITab or ControlPane. One acts as expected, the other destroys / reloads the WebBrowser control.
Have you had any further thoughts on why the behaviour differs?
Closing a DockableControlPane does not destroy the control, it hides the control. And the subsequent Show(), makes the control visible.
When you close the MDI tab, it does close the tab and the underlying MDI child form and in this case it closes the URL. You are right the child form is closed and disposed.
It is possible normally to use the following to hide and show the content of the mdiTab.
mdiTab.Form.Visible = false;
mdiTab.Form.Visible = true;
Your browser control is not on a form per say, but when I used that code, the tab continues to exist and you can show and hide the tab. Although the browser seems to still be there, the browser scripts seem to need to be rerun.
I added a button to refresh the browser as you can see in my sample.
Please let me know if you have questions.