Windows XP NetAdvantage Suite 2006 VS 2005 DotNet CLR 2.0.
I have an MDI Form with a UltraWinToolbar that contains a ListTool. The items in the ListTool are populated at runtime. In a previous version of NetAdvantage Suite, when the ListTool contained more items than could fit on screen arrows where automatically drawn at top/bottom that allowed the user to scroll through the items. This no longer happens, instead ListTool has property MaxItemsToDisplay, which I set to 20. Now when there are more than 20 items "More...." item is added to bottom of list. Selecting it opens a Modal Dialog to allow selection of complete list.
My problem is that selection of the item in the list adds a new MDi Child Window and when the selection happens via the Modal Dialog then focus is not retained in the new Mdi Child. The Modal Dialog seems to have focus even after user has selected the item and until the ToolClick event has been completely processed. has anyone come across this problem or know of a solution or workaround?
Thanks,
Chris
I recently had a similar problem where a new child window was created while a modal form was displayed.
The solution was to specifically reset focus to this new window after the modal dialog closes.Since it will always be the LAST child window in the list you can use the following code:
Me.MdiChildren(Me.MdiChildren.Length - 1).Focus()
However if there is more than 1 child window initially (so that you dont know where the focus is before this) and there is any chance that a new window will not be created you will need to save the Me.MdiChildren.Length before executing the command and only execute the above line if the value is larger than your saved value after it completes. (ie. only if a new window really was created.) This avoids an unintentional focus shift when no new window is created.