Activate, Deactivate
These events fire when forms and pages become active or inactive. For a project hook, these events fire when the associated project becomes active or inactive.
Usage |
PROCEDURE oObject.Activate | oObject.Deactivate |
Pages next. A page's Activate fires in two situations—when that page comes to the top of the page frame (that is, when you change pages) and when focus on a form is on the page and the form is activated. (A page is not refreshed when it comes to the top; check out Refresh for details and UIEnable for a solution.) A page's Deactivate fires only when a different page in the page frame comes to the top. We can't figure out why the page behaves differently when the form is activated than when it's deactivated. We could argue this one either way—that is, we'd be comfortable with either the page's Activate and Deactivate firing when the form loses focus, or not firing when the form loses focus. But why are they different? |
When the project is "rolled up" (collapsed), the project hook's Activate doesn't fire when you click on the title bar. Activate for the project hook of a collapsed project does fire when you click on one of the tabs to expand it. We consider the first behavior a bug, since Activate does fire when you click on the title bar of an expanded project. |
This next one, much as we dislike it, we can't bring ourselves to call it a bug. When a project is docked, the project hook's Activate and Deactivate methods don't ever fire. We think that, in this situation, the project is acting like a toolbar, and as we said above, Activate and Deactivate almost never fire for toolbars. So this one is probably by design. Unfortunately, it means we can't do a lot of the things we'd like to do with these events, since we can't count on their firing. |
Example |
* Only the active page in a page frame is refreshed by * the PageFrame's Refresh method. So, when you move a page * to the top, it's generally a good idea to refresh it. * You'd do that in the page's Activate method: This.Refresh() |
See Also |
Activate Window, Deactivate Window, Form, Formset, Hide, Page, PageFrame, ProjectHook, Show, Toolbar, UIEnable |