If the event is coming in on a separate thread (not clear from your post)
then you must use Invoke to access any UI element.
-Chris
"John Boren" <John
(E-Mail Removed)> wrote in message
news:C62A1F49-0A88-4383-9168-(E-Mail Removed)...
> I'm writing an application where I have incoming data via TCP into a
Static
> global routine. From that routine, I'm wanting to display the error
message
> on a form.
>
> Now I have tried many variations of getting access to the object ( a
message
> label), but basically, as soon as it tries to assign the message
label.text,
> the program just stops in that code.
>
> I'm using VS 2003 - C# - Writing for WM 2003 SE
>
> 1. I'm calling this from Public Static routine in a different namespace.
> 2. FSignon is the name of the form.
> 3. FSignon_int is a public reference to the form:
> public static FSignon FSignon_int;
> 4. The form is displaying.
> 5. I'm then trying to assign the message label as follows:
>
> public static void ipInMsg(string mytext);
>
> FSignon.FSignon_int.MsgLabel.Text=mytext;
> (debugging ends on this line)
>
> So, how is one normally suppose to be able to assign or change values of
> objects on other forms? I was thinking about window messaging .. but not
> sure on the impact with CF or some Invoke statement?
>
> Just needs some direction here.
>
> Thanks
> John
>
>
>