W
William Stacey
Have a MDI parent with a menu and a MDI child with a menu that gets added to
the parent - nothing fancy. One the parent, there is a menu (file/new) item
that loads and shows a new child. Works fine so far. However, if you click
(file/new) 2 or 3rd times, without actually clicking on the new child first,
I will get: "An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll Additional information: Object
reference not set to an instance of an object."
However, if I click inside the ListView in the first child (I think because
it changes the focus off the menu) then I can continue creating children
without this error. You must *actually click the control as setting the
focus in the code does not stop the problem. This does not happen if I
remove the menu from the child or if I do not start the child as MDI.
Therefore, I am guessing it is an issue with merged menus and/or mdi
children. Anyone run into this before? Is there a way to simulate the
mouse click in code (i.e. not just setting the focus).
--wjs
the parent - nothing fancy. One the parent, there is a menu (file/new) item
that loads and shows a new child. Works fine so far. However, if you click
(file/new) 2 or 3rd times, without actually clicking on the new child first,
I will get: "An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll Additional information: Object
reference not set to an instance of an object."
However, if I click inside the ListView in the first child (I think because
it changes the focus off the menu) then I can continue creating children
without this error. You must *actually click the control as setting the
focus in the code does not stop the problem. This does not happen if I
remove the menu from the child or if I do not start the child as MDI.
Therefore, I am guessing it is an issue with merged menus and/or mdi
children. Anyone run into this before? Is there a way to simulate the
mouse click in code (i.e. not just setting the focus).
--wjs