Select to view content in your preferred language

System.Windows.Forms.AxHost+InvalidActiveXStateExc eption

754
1
05-04-2010 03:11 AM
pavankumar
New Contributor
Hi, We are developing a WPF based Engine application. In this application, we have tab controls, which have a WindowsFormsHost, which holds the instance of the mapcontrol.

When we switch between the tabs, we remove the mapcontrol from the previous windows formshost and place it in the current tab page's windows form host.

Further, we are setting some properties of the mapcontrol.

In certain cases, when i set the properties of the mapcontrol, i get this error: 'System.Windows.Forms.AxHost+InvalidActiveXStateException' .

I learnt that this error arises when the mapcontrol instance exists but is not held by any container that can draw it.

What i wanted to know was, is there any way to know the activeXState of the mapcontrol? Just checking whether the mapcontrol is null isnt helpful.

Thanks.
0 Kudos
1 Reply
NickClayton
Emerging Contributor
Try looking into MapControl.OcxState
That may help you out.
0 Kudos