Showing the form again also fires one event: Hiding and re-Showing the Form: deactivate and activateĪ click on the Hide button fires one event: ![]() Except for the missing deactivate no surprises. The Unload Me command in the ButtonUnload_Click handler fires the Quer圜lose and Terminate events. If we close the form with a click on the Unload button the trace list becomes: Indeed, there is no Deactivate event fired. Click the window Close button immediately after startup and the trace list results in: So, if we unload or hide the form we would expect a deactivate event to be raised. Quote from the Visual Basic Language Reference: “The Deactivate event occurs when an object is no longer the active window”. The Forms object library seems to do the opposite: first activate/enter the low level control, then activate the form. Notice the difference with the workbook event model, where activation is top-down: Workbook – Window – Worksheet. The second event only fires if the form contains a control that can take the focus and is enabled to do so. Showing the form from an unloaded state results in: ![]() See Debug and trace in VBA for details on this debug technique. Most of these event handlers contain only two lines of code to create a trace list in the VBE Immediate Window. In the code module of the form the most relevant events are defined.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |