Form activeForm = System.Windows.Forms.Form.ActiveForm;
Form activeMdiChildForm = activeForm.ActiveMdiChild;
This code is in a component of mine and is triggered from various places
within my application. My problem is that when I run the app
Form.ActiveForm is always set, whereas when I am stepping through code using
the debugger it is always null. This results in a NullReferenceException
whenever I am debugging and a line of code executes that directly or
indirectly triggers the event that invokes this code.
Is there some kind of a workaround for this problem? It is very counter
productive!
Thanks
Pete