In the C# Console Application project I have to hide and show form with MapPoint Control on it. I have to be able to hide and show a form without closing and saving map every time. Calling the Form.Hide() method causes the MapPoint control loose a map and move control to the UNINITIALIZED state.
The code from the console application:
MapFormInst = new Form1();
//MapFormInst.ShowDialog(); //if I uncomment this line the next line causes the exception
MapFormInst.ShowDialog(); //shows a map
// calling the Form.Hide() by ckicking the Hide button on the from
MapFormInst.ShowDialog(); //doesn't show a map
If I try to hide and show control while form is visible. It works fine. However if I try to close a map and open a new one while MapPointControl is invisible it causes the exception with the message that to perform that method (NewMap) the MapPointControl has to be in the available state. Is the MapPoint Control was developed this way the it has to open,save and close a map every time when you have to show and hide the form? Do you have any other suggestions how to hide a form instead of using Form.Hide() method?