Select to view content in your preferred language

Application.Idle not available in modeless forms

856
1
09-18-2011 06:24 AM
YvoWeidmann
Deactivated User
Dear list
I try to use the Application.Idle event to handle to appearance of controls in a Add-In using Windows.Forms with defining the event handler in the constructor of the form:
Application.Idle += new EventHandler(Application_Idle);

Calling the form with (modal)
selectionMutation.ShowDialog()
the event handler is called as soon as the application goes idle.

As soon as I call the form with (modeless)
selectionMutation.Show()
the event is not reaching the form anymore and the event handler will not be called.

Does anyone knows the reason for that and to overcome this problem?

Looking forward to any hint,
Yvo
0 Kudos
1 Reply
YvoWeidmann
Deactivated User
Dear list

After extensive contact with the ESRI support team we figured out, that the above mentioned approach is not working. In case of modeless forms, the Application.Idle event never reaches the form. This happens only in case of modal forms.

The only workaround is to use the Update-method of the calling AddIn or ICommand. Within this method you could call a public method OnUpdate of the form. That works quite well, but unfortunately, there is a certain delay when Update() is called from ArcMap.

Best regards,
Yvo
0 Kudos