0

Please have a look at the attached picture.
I am creating a Windows Form application in C#. I need to display the 'carry' string bit-by-bit with a considerable difference of appearing time.
For example:
if the carry string is 11011
I need to diplay it like-

**1
*11//overwrite the above
011//overwrite the above. I have used Thread.Sleep() and timers, but then UI gets locked and the whole string is displayed once the "pause" is over.

Attachments Capture.JPG 63.78 KB
5
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by arunkumars
1

The Thread.Sleep() will still lock the UI (you are telling it to sleep, after all). If you want things to happen on a schedule use a timer.

Votes + Comments
The best way
0

Simple piece of code to make 5 second delay:

for (DateTime sec = DateTime.Now;  DateTime.Now < sec+ new TimeSpan(0,0,5); )
     Application.DoEvents();
0

I would suggest you to use a loop and overwrite the text box for a 1 sec delay...
for()
{
texbox += textbox + string;
Thread.Sleep(1000);
}
or
may be u can use a timer like momerath said..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.