PC Review


Reply
Thread Tools Rate Thread

Clearing an Event

 
 
=?Utf-8?B?QnJhZA==?=
Guest
Posts: n/a
 
      22nd May 2004
A quick question...

In my program I handle an event, but the way it is programed the event gets "handled" twice. Is there a way to clear the event after it is handled the first time

Thank
Brad
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd May 2004
Hi Brad,

You can either set a switch (the most simple method) or otherwise remove the
handler temporary (the most difficult method).

Did you know the static keyword which is very usable for a switch, with that
you do not have to set it public but can keep it in your procedure something
as.

static myswitch as boolean

if myswitch then
'do what you want
myswitch = false

I hope this helps?

Cor


 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      22nd May 2004
* "=?Utf-8?B?QnJhZA==?=" <(E-Mail Removed)> scripsit:
> In my program I handle an event, but the way it is programed the event
> gets "handled" twice. Is there a way to clear the event after it is
> handled the first time.


If your event is called 'Foo', then you can use 'FooEvent' to get "more
options". There you can get the 'InvocationList', add handlers
('Combine') and remove handlers using 'Remove'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing the All-Day Event checkbox Amy Microsoft Outlook Calendar 2 29th Apr 2010 06:56 PM
Clearing all event handler attached to an event Navaneeth.K.N Microsoft C# .NET 8 26th May 2009 07:24 AM
Clearing event queues greg Microsoft Dot NET Framework 4 22nd Feb 2008 10:59 AM
Clearing Event Logs =?Utf-8?B?SmFjb2Jzb24gVVNBRg==?= Microsoft Windows 2000 1 13th Oct 2004 08:50 PM
Clearing combobox with AfterUpdate event Max Moor Microsoft Access Forms 2 13th Dec 2003 06:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:05 PM.