In fact, the above code works exactly as you wrote: first the first record is added, then the stream is delayed, then the second record is added. But you see another result: first, a delay, then the addition of two records. This is due to the fact that you delay in the main, UI, stream. The UI thread has a so-called. message queue that it processes. After adding the first record to this queue, a message is added to draw the text in the control. But since you immediately make a delay, the processing of this queue stops and the thread simply does not have time to draw the first entry in the control. After the delay ends, another message is added to the queue, and the thread draws both entries.
It is difficult to advise how to fix it, because it is not clear what you want to achieve. Also, making delays (especially in the UI thread) is usually a bad idea. As an option, you can ask the UI thread to process the message queue before the delay:
listBox1.Items.Add("First Item"); Application.DoEvents(); Thread.Sleep(5000); listBox1.Items.Add("Second Item");
But, I repeat, this is only in order to satisfy curiosity. In a good way, you should get rid of the delay and do what you want in a different way. For example, use a timer or async / await .