Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

delay a function on winform

//Your window Constructor
public MyWindow()
{
    InitializeComponent();

    this.Cursor = Cursors.WaitCursor; 
    this.Enabled = false;
    WaitSomeTime();

    //load stuff
    .....
}

public async void WaitSomeTime()
{
    await Task.Delay(5000);
    this.Enabled = true;
    this.Cursor = Cursors.Default; 
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delay #function #winform
ADD COMMENT
Topic
Name
8+2 =