e.TabbedMdiWindow.Visible in WindowCreated-Event

Docking/MDI for Windows Forms Forum

Posted 17 years ago by Michael Knorr
Avatar
Hi,

thanks for quickly adding the WindowCloseReason!

Another problem:
I'm loading the docking layout from a file and use the WindowCreated-Event to add content to the tool windows. Some tool windows react on events from other tool windows, but only when they are visible.

In the WindowCreated-Event e.TabbedMdiWindow.Visible is always true and it stays true regardless if the tool window actually becomes visible or stays hidden. The visible property of the tool window (and its controls) only becomes false when it was visible is hidden during run time.

This behaviour can be easily reproduced with the sample application. Add additional tool windows to the sample app, hide them and save the layout. Close and reopen the sample app, then load the layout with the hidden tool windows. When you put a break point on dockManager_WindowCreated you can check that e.TabbedMdiWindow.Visible is always true.

Is it possible to correct this with the next maintenance release?
Otherwise I have to find some workaround.

(On the long term I want to switch to lazy initialization of the tool windows, which will resolve this problem as well...)

Regards,
Michael Knorr

Comments (1)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Michael,

The Control.Visible default is to be true and we were not changing it until the window became active. That's why you saw it as true all the time in WindowCreated. I've added code to the TabbedMdiWindow base class to set Visible = false before WindowCreated fires. That will be in the next maintenance release.

If you are trying to do lazy initialization then use the WindowInitializing event. That will only fire before the first time the window becomes active in the layout.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.