Thread: Screen events

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    3

    Screen events


    I'm having troubles with the screen events:

    OnShow, OnActivate, OnPaint and OnResize

    I studied some texts in the iNet but the doubts remains.

    In which situations occurs each of these events? Consider Show, ShowModal and even for a screen that remains appearing in the screen and the application gives the focus various times while the screen remains appearing.

    In which situation occur each event?

    Greetings from São Paulo - Brazil

    Ricardo
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    55
    Rep Power
    7

    Thumbs up


    [QUOTE=nightrider43]I'm having troubles with the screen events:

    OnShow, OnActivate, OnPaint and OnResize

    ---> SIMPLE FORM <-----
    ShowMessage( 'who comes first' ) in each EVENT

    OnShow -> after the make all components in forms and ready to show

    OnActive -> when the form is click or activated (you are in another application and come back to delphi app)

    see the help for another information about the other events
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    3
    Sorry, but my version of Delphi is without help or it is malfunctioning.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2008
    Posts
    55
    Rep Power
    7
    Originally Posted by nightrider43
    Sorry, but my version of Delphi is without help or it is malfunctioning.
    Search in internet one new version hheheh
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    Croatia
    Posts
    65
    Rep Power
    3
    On show is when your script something shov, on activate is when some clicks or activate some option.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    São Paulo - Brazil
    Posts
    35
    Rep Power
    3
    I made a test creating a Form1 that has a button that execute de Show method creating a Form2 with a button only to close it.

    My conclusions are:

    In the first time I click the button in Form1 to show Form2 the following occurs:
    event create
    event show
    event paint
    ---> Form2 is showed
    event activate
    event resize (focus in Form2)

    I click the button in Form2 and it is closed via Close method call

    In the second time I click the button in Form1 to show Form2 the following occurs: (remember that Form2 is already in memory)
    event show
    event paint
    ---> Form2 is showed
    event activate(focus in Form2)

    I would like to know if these conclusions are correct or I misunderstand some step/event

    Ricardo

IMN logo majestic logo threadwatch logo seochat tools logo