Click here to Skip to main content
15,900,724 members
Articles / Programming Languages / C#

Run method one time only

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
18 Jan 2013CPOL 0  
You can remove the event handler when it is executed. In fact, any event handler that you add manually should typically also be removed manually (at some point).void Myevent(object sender, EventArgs e){ Application.Idle -= Myevent; // Other code here (assuming you don't want to...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Canada Canada
Programmer at Maid LABS from 2003 (www.maidlabs.com)

Programmer-Analyst at Viasat Geo Technoligies from 1995 to 2002 (www.viasat-geo.com).

I have studied at École Polytechnique de Montréal in computer engineering.

Comments and Discussions