Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to timeout a button_click event

$
0
0

Hi everyone,

I wish to create a situation whereby I can timeout a button click event thus:

  private void btnInitialise_Click(object sender, EventArgs e)
        {

           writeData();

        }

I want writeData to terminate after 5 second if it fails to complete.

Many thanks in advance.


Viewing all articles
Browse latest Browse all 12583

Trending Articles