FIX: Toolbar Events Fire Differently When Using Dock Method (141425)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
This article was previously published under Q141425 SYMPTOMS
The BeforeDock, Undock, and AfterDock events are not triggered in the same
order when a toolbar is docked interactively versus when a toolbar is
docked under program control.
When the dock position of a toolbar is changed interactively, the events
fire in the following order:
BeforeDock, AfterDock
When the dock position of a toolbar is changed under program control with
the Dock method, the events fire in the following order:
BeforeDock, Undock, BeforeDock, AfterDock
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem has been fixed in
Visual FoxPro 5.0 for Windows.
WORKAROUND
There is no way to prevent the events from occurring, or to trigger the
events under program control. However, if you have code for the BeforeDock
and Undock methods and do not want to call it when the Dock method is
executed, follow these steps:
- Add a property to the class called lDockit.
- In the Dock method, set the value of this property to true (.T.) as in
this example:
IF THIS.DockPosition != -1 && The toolbar is already docked
THIS.lDockit=.T.
ENDIF
- In the event handler for BeforeDock, add the following:
IF THIS.lDockit <> .T.
<your code here>
ENDIF
- In the event handler for Undock, add the following:
IF THIS.lDockit<>.T.
<your code here>
ELSE
THIS.lDockit=.F.
ENDIF
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | kbBug kbfix kbvfp500fix KB141425 |
---|
|