G?day,



I have a PocketPC 2003 app using CF and C#.

I am interrogating a GPS unit via the com port and a .dll (CFSerialIO).

The comport fires an event when there is data. In the event I display
the data from the com port onto a Listbox.

All this is on a secondary form to the main application form.

It works fine if I call the second form modeless, the Listbox updates
nicely.

If I call the form Modally the listbox never updates.

I have tried doing:

lstBox.Invoke( new EventHandler( updateUI ) );

private void updateUI(?)

{

lstBox.Items.Add( returnedGPSData );
Application.DoEvents();
}

in the data received event of the Com Class. But still no go.

Ideas?

Re: UI Not Updating on Modal form from ComPort Data received event by nospam

nospam
Wed Aug 17 16:44:43 CDT 2005

nospam wrote:
> G?day,
>
>
>
> I have a PocketPC 2003 app using CF and C#.
>
> I am interrogating a GPS unit via the com port and a .dll (CFSerialIO).
>
> The comport fires an event when there is data. In the event I display
> the data from the com port onto a Listbox.
>
> All this is on a secondary form to the main application form.
>
> It works fine if I call the second form modeless, the Listbox updates
> nicely.
>
> If I call the form Modally the listbox never updates.
>
> I have tried doing:
>
> lstBox.Invoke( new EventHandler( updateUI ) );
>
> private void updateUI(?)
>
> {
>
> lstBox.Items.Add( returnedGPSData );
> Application.DoEvents();
> }
>
> in the data received event of the Com Class. But still no go.
>
> Ideas?

Replying to my own post. I had to put the GPS read event in its own
thread and then call the invoke.