The program often downloads from the Internet, in itself, it does not take a lot of time, but some people have slow Internet. Therefore, how can you make sure that during the operation of one procedure it shows some kind of download, even just the same frame with animation, just so that the user can see that the program works and does not hang.
2 answers
@Pandakun , I’ll give another thought to @KiTE :
- Show the window in which the animation will be drawn. You can use the normal window with
BorderStyle = bsNone
. You can show TPanel in the open window, on top of other components. - Start the download. In any implementation, the download should go in a separate thread.
- Draw the loading indicator on the created panel / window as you like. Although the outline of the timer, even though
TProgressBar
, at least someTAnimate
. - After the download is complete, remove your panel / window.
And the way I do it does not affect.
A separate stream for downloading is needed so that you do not hang the drawing of the window with the indicator.
- Yeah, this is reasonable, but can a small example be just how to download a file from the Internet via ICS? - zerpico
- Alas, I am not familiar with ICS. - Nofate ♦
- And in any other way, I just don’t quite understand what a "separate stream" is - zerpico
|
And in any other way, I just do not quite understand what a "separate stream"
An example of working with threads in this link .
|
TThread
. - KiTE