We are using the Dock Manager's PaneDeactivate event to run processes that must occur before the user can continue working on the next pane they have selected.
What I am finding is that when a dialog box is launched from the active pane the PaneDeactive event is firing, which I guess makes sense, however this means that the code we expect to run when switching panes is firing when we have not actually switched to another pane.
I was hoping to find an event such as the TabSelecting event which is raised by the Tabbed MDI Manager, which allows me to determine which tab I am leaving and which tab I am selecting, but there is no such event on the Dock Manager.
When the PaneDeactivate event fires, how can I establish that no other pane is actually about to be activated? In my scenario I have just opened a dialog box and will be returning to the tab that has just deactivated and so need to be able to prevent execution of the code that is only required when switching from one pane to another?
Thanks in advance,
Jim.
We are running v13.1.20131.2040 btw
Hello Jim,
You are correct. When a dialog box is launched from the active pane the PaneDeactive event is firing. What is the important detail here is PaneDeactive event is fired after dilog box is closed. This allows you by overriding OnActivated event of your Main form to set the active pane dialog box was launched from to become active again. To achieve this you need to save the last active control in Main form Deactivate event and to restore it in OnActivate event.
Please find a sample solution implementing above described procedure.
Please let me know if this is what you are looking for or if I am missing something.