Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

Getting mouse/keyboard input while in a repeat/until loop

My application calls a Form which displays a graphic. The Graphic is in a repeat/until loop wherein the graphic content is updated as a function of time.
The form has a menu with "Exit" "Save" "Print" etc sub items.

While in the time update loop, the form does not accept keyboard or mouse input. I have the form KeyPreview set to true, but it will not respond to mouse or keyboard input.
If I remove the repeat/until loop, to display the graphic as of one fixed time,  every thing works OK.

Is it possible to do a mouse/keyboard poll within the loop to get the menu items working? My earlier Dos protected mode version had no problems with this.

Any help much appreciated!

1 Solution
The problem is when u put something in the loop in one of the component events there is no appropriate answer for other events
in fact your computer do the job inside one component events and when is finished its pass the controll to the event driver

u mey

1 Use theards
2 use timer component and break a loop in smaler peaces and start them in the component event and finish in more sequvences in the on timer event
Try putting Application.ProcessMessages in the loop.
DXPeteAuthor Commented:
This problem had caused me a lot of grief! Many thanks to the respondents for their help.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now