Strange behaviour of function Sleep() used in repeat until in Delphi

前端 未结 4 1308
走了就别回头了
走了就别回头了 2021-01-19 01:28

I have function which is reaction on button click. When I click on the button it should start repeat and write values form an array and show them in labels on main form. Pro

4条回答
  •  心在旅途
    2021-01-19 02:11

    Don't use Sleep function in GUI thread because you are blocking normal message processing and your application behaves strangely.

    It is not clear why you use Sleep in your code. Probably you should update labels from OnTimer event handler of TTimer component instead of using a loop.

提交回复
热议问题