[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2537.0. "Order of events on startup" by LEXS01::GINGER (Ron Ginger) Fri Apr 18 1997 10:31

    Where can I fand a good list of all event and the order in which they
    occur? Specifically I want to know the order in starting up an
    application and its main form.
    
    Where shuold I put my 'once-only' startup code for an application? In
    this case it needs to change the main form size, and adjust several
    frames to suit.
    
T.RTitleUserPersonal
Name
DateLines
2537.1Load and Activate are the ones to look at.CHEFS::TREVENNOR_AA child of initMon Apr 21 1997 05:1927
--------------------------------------------------------------------------------
    
    Ron,
    	Unless you plan to "Unload" the form during run-time (as opposed to
    hiding it by changing the "Visible" property value) your one-off
    processing should go into the "Load" event handler. Things you want to
p    do every time the form accquires focus or is made visible should be
    laced in the "Activate" event handler.
    
    
    If you plan to unload and reload the form at run-time (slow) you will
    have to resort to a global Boolean which you set the first time thru -
    eg:
    
    if (RonsFormSetupHasBeenDone=False) then
       MainForm.width=Screen.Width
       MainForm.height=Screen.Height
       .
       .
       RonsFormSetupHasBeenDone=True
    endif
    
    
    Rgds
    Alan T.
    
 
2537.2LEXS01::GINGERRon GingerTue Apr 22 1997 11:464
    Thanks.
    
    I intend to keep the form loaded thruthe entire session, just hiding it
    from time to time.