Re: Tricky problem with event handling

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: LiFo (ikkieg_at_hotmail.com)
Date: 08/12/04


Date: Thu, 12 Aug 2004 20:52:42 +0200

i have had simmilar problem updating a ListView from multible threads
my solution was to use Lock on the update methode

"Tim Gallivan" <nospampleasetim.gallivan@edu.gov.on.ca> wrote in message
news:%23DV%23SkJgEHA.536@TK2MSFTNGP11.phx.gbl...
> Hi group,
>
> I'm having a strange problem with event handling. My project has a form
with
> a textbox that creates 25 instances of class A when a button is clicked.
> Class A raises the event without error, I have proved this by having it
use
> a streamwriter to create and write to a simple text file after raising the
> event. Twenty-five files are created each time the button is pressed.
>
> The form is wired up to the event (rr.OnComplete += new
> ReqResp.ReqRespEventHandler(TestHandler); ...), grabs the EventArgs and
> updates the textbox. I've put MessageBoxes in TestHandler, and it displays
> 25 boxes each time. The problem is that the textbox itself rarely displays
> all 25 event messages (as few as 16, up to all 25). Are things happening
too
> fast here? I've tried Suspending the Layout, to no avail.
>
> Any ideas here?
>
> --
> Tim Gallivan
> I know I'm a great teacher because when I give a lesson, the person never
> comes back.
>
>


Quantcast