472,121 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

Tricky problem with event handling

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.
Nov 16 '05 #1
2 1258
i have had simmilar problem updating a ListView from multible threads
my solution was to use Lock on the update methode

"Tim Gallivan" <no**********************@edu.gov.on.ca> wrote in message
news:%2*****************@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.

Nov 16 '05 #2
Lock?

--
Tim Gallivan
I know I'm a great teacher because when I give a lesson, the person never
comes back.

"LiFo" <ik****@hotmail.com> wrote in message
news:O3*************@TK2MSFTNGP10.phx.gbl...
i have had simmilar problem updating a ListView from multible threads
my solution was to use Lock on the update methode

"Tim Gallivan" <no**********************@edu.gov.on.ca> wrote in message
news:%2*****************@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.


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Marc Tanner | last post: by
2 posts views Thread by Marcia Gulesian | last post: by
4 posts views Thread by hillcountry74 | last post: by
7 posts views Thread by Matt | last post: by
7 posts views Thread by Ernesto | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.