How to Call Event Procs. w/No Param. from VB FormLast reviewed: June 21, 1995Article ID: Q118645 |
The information in this article applies to:
SUMMARYNormally, it is not possible to call event procedures of one form from another. However, there is a way to indirectly call event procedures that do not have any parameters passed to them from another form.
MORE INFORMATIONEvent procedures are called internally by Windows in response to user events, like a mouse click or a keypress, associated with any control or object. These event procedures are not visible outside of the form to which they belong. They are private procedures and hence cannot be called directly from another form. In some cases, Windows passes a parameter to these procedures when it calls them. For example, the MouseDown event is passed the following four parameters:
Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)Sometimes, you may want to call one of these event procedures from the application code itself. However this possible only if no parameters have to be passed, because these are totally dependent on the state of the system as Windows fires these events.
Step-by-Step ExampleHere is an example that calls the Form_Click() event of Form2 from Form1:
|
Additional reference words: 2.00 3.00 1.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |