Results 1 to 6 of 6

Thread: form Focus

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Mobile AL
    Posts
    4

    Unhappy

    I have written a program to install an application patch on remote machines.
    This is done by mapping a drive to a PC that is listed in a database, then using the copyfolder command installs the new patch. The program, then disconnects the mapping and moves to the next PC in the list.
    My problem comes if I wish to end the program early. Because this program runs in a do while database is not EOF, the form will not respond when I click on the exit button, or any other button as if it has lost focus or is busy copying the files.
    Is there a way that I can stop the form from loosing functionality while thing is in the loop.

    Thanks
    [email protected]

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360

    Lightbulb

    I am somewhat new at this, however you can add a value to the exit button, say boolean for example, (or a numeric) if the button is activated, then the value will change.

    Then add a line of code in your do loop that says

    do while......(existing code)...And _
    (boolean value of button) = True

    then each cycle through the loop it will determine weather the value had changed.

    I hope this helps!
    Lee
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Location
    Mobile AL
    Posts
    4
    The problem is that I can not click on anything on the form as it has lost focus as the program is busy mapping drives and copying files.

  4. #4
    Junior Member
    Join Date
    Sep 2000
    Posts
    20
    Lee M.

    You could try using the Doevents statement in the loop
    which should catch a mouse click on a exit button (eventually)
    but most people swear against the doevents statement for various reasons.
    Use it as a last resort.

    John

  5. #5
    Junior Member
    Join Date
    Sep 2000
    Posts
    20
    sorry I mean sknight!!

  6. #6
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341

    You could......

    ......try adding another form to that app and that has the exit button on it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width