I have used the demo project for the MapControl and altered it to my needs.
This works so far. Now I want to repeat this in my actual project and I have copy & pasted all the code and everything is exact the same as in the altered demo project but in the actual project the MapControl shows nothing, only a gray background.
There are no errors.
The only thing I see on the MapControl is the mouse pointer changing when I click on it.
I even copy & pasted the MapControl but still no map is shown.
I can execute code to put items on the map, I get no errors but I can't see anything.
I can execute code to calculate a route and it returns the correct information but I can't see anything.
How is it possible that the MapControl works perfectly in one application and not in another?
Can anybody give me a clue in what direction to search for this?
I posted this problem on DevExpress forum also but unlike usually it stays quiet there...
EDIT:
I removed the Copy/Pasted MapControl from the form and started from scratch.
But the result is the same. I get no errors and calculating a route returns correct values, but the map still is too shy and refuses to show itself.
EDIT 2:
I created a new Bing Key but the result is the same, no errors but also no maps visible
EDIT 3:
I added a MiniMap and after entering the Bing Key the mini maps shows a map on design time
But on runtime its all gone again
Found the reason finally
I finally got it working. In the actual project all forms are derived from a base form This base form has this overriden method
protected override CreateParams CreateParams
{
get
{
var cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
return cp;
}
}
When I comment out this code the map finally shows up. Now I need to figure out why this code is there and if its really needed how I can keep it and still see the map