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

    Join Date
    Sep 2004
    Location
    Romania
    Posts
    173
    Rep Power
    11

    Question Please Wait form


    What is the best way to create a form (always on top maybe) that shows some application progress in a Memo or something ?

    Example:
    >>FormShow
    Login .................... OK
    Doing something ..... OK
    Doing other things ... OK
    Cleaning up ............ OK
    >>FormHide
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,642
    Rep Power
    4247
    I usually do it like this:
    1. In the form, I have a memo object (and perhaps an animated control).
    2. To do the actual work, I create a TThread derived object and execute it from the form.
    3. The TThread object updates the form as it does various tasks.

    The advantage of this is that I'm guaranteed that the form is created first before the thread executes, since the form creates the thread object. Also, you can easily pass the form's variable to the thread since you're creating it from the form.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo