You can use the DockingManager.DockStateChanged and DockingManager.DockVisibilityChanged events to determine whether a control is being autohidden using the pushpin or closed through the 'X' button.
The DockStateChanged event is fired whenever a control enters or exits the autohide mode. Querying for DockingManager.GetAutoHideMode() on the control should allow you to ascertain the autohide enter/exit state. The DockVisibilityChanged event, on the other hand, is fired only when the control is hidden/shown either by the DockingManager.SetDockVisibility() method or by clicking the Close button. Querying for the control's visibility state through the GetDockVisibility() method should allow you to determine whether the control is being hidden or shown.
DRDadang RachmadSeptember 17, 2002 11:34 AM UTC
Thank you, what I need most is the DockVisibilityChanged
I want to use the GetAutoHideMode but I want to get the control which name is "XXX" by iterating the DockingManager. It always failed in DockingManager1.Controls.Current. Whats wrong?
dim controlName as string = "XXX"
dim control as control
control = DockingManager1.Controls.Current
If control.Name = controlName Then
Prakash SSeptember 17, 2002 02:08 PM UTC
This seems like an implementation issue. You should not have any trouble accessing a docked control through it's Name property. Is it possible that the control may not have been dock-enabled? Please try to provide us with a sample that shows the problem.
DRDadang RachmadSeptember 17, 2002 10:42 PM UTC
the sample is in the mainform.vb but disable by remarks that I send for the topic "need to access textbox.text"
Prakash SSeptember 19, 2002 03:19 PM UTC
The problem was being caused by your code calling DockingManager.Controls several times; each call was returning a fresh instance of the collection's enumerator and consequently IEnumerator.Current was being accessed on a non-positioned instance. Modifying the code as shown below takes care of the problem,
Dim enumerator As IEnumerator
enumerator = Me.DockingManager1.Controls
control = enumerator.Current
If control.Name = "Identity" Then
controlRet = control