Help System.Threading Sleep? (WITH#)

I am new to C # and I am using System.Threading.

I have this code:

UISystem.SetScene(Scene_Menu);
Thread.Sleep (9000);
p.Text="HELLO";
Thread.Sleep(9000);
p.Text="WORLD";

It delays 18 seconds, but p.Text="HELLO"does not show between sleep functions. What is the problem with my code?

Thank.

Timers do not work, since I cannot edit p from a separate stream.

Application.DoEvents () is a Windows Forms function, I am creating an application in PS Vita.

+3
source share
1 answer

, Thread.Sleep. . (1) , , , (2) " , , "; .

thread.Sleep, , , . , . , ; , , .

, , , , , . , , " , , - ", , .

, DoEvents, , DoEvents, , . ; , , , ! , , , .. .. , . DoEvents - " ", . , , .

: , DoEvents , , . , . .

, , , - . # 4 - , , .

, , . . , . .

# 5 - await . , , , , , , . # 5 :

UISystem.SetScene(Scene_Menu); 
await Task.Delay (9000); 
p.Text="HELLO"; 
await Task.Delay(9000); 
p.Text="WORLD"; 

# 5 ; .:

http://msdn.microsoft.com/en-us/async

DoEvents - , . MSDN:

http://msdn.microsoft.com/en-us/magazine/hh456401.aspx

+17

All Articles