Daniel
Wed Apr 05 05:48:19 CDT 2006
If you read the link I sent and the links it points to you will get the
answer to the question you ask, gain a better understanding on why the
advice was given and also never face this problem again.
Whether you decide to Invoke from wherever you call that routine so the
whole method is on the UI thread or whether you decide to split the method
so the msgbox happens before Invoking is your decision which you will be
able to make once you follow the links.
Cheers
Daniel
--
http://www.danielmoth.com/Blog/
"Gandalf" <Gandalf@discussions.microsoft.com> wrote in message
news:56EA23C0-DF46-426D-80B0-9D750D32DEB9@microsoft.com...
> OK, thanks.
> But what do you mean exactly, should I use this method after
> "MessageBox.Show()" ? So "textBox2.Invoke()" in the sample of code I gave
> you
> in the last post ?
>
> Thanks in advance for any information.
>
> "Daniel Moth" wrote:
>
>> Like Chris is implying, chances are you are running that method on a
>> worker
>> thread and hence should use Control.Invoke before touching UI elements:
>>
http://www.danielmoth.com/Blog/2004/10/invoke-cf-and-full-fx.html
>>
>> Cheers
>> Daniel
>> --
>>
http://www.danielmoth.com/Blog/
>>
>> "Gandalf" <Gandalf@discussions.microsoft.com> wrote in message
>> news:44259113-26A5-40A8-8051-2559258F9AA1@microsoft.com...
>> > Hi,
>> >
>> > Under a Windows CE .NET 4.2 OS, I have a problem with a C# application
>> > which
>> > is the following :
>> > when I call often a routine, my application is blocked on the
>> > MessageBox
>> > and
>> > I must do a reboot of the PDA.
>> >
>> > The routine is the following :
>> >
>> > ---------------------------------------------------------------------
>> > private void routine()
>> > {
>> > MessageBox.Show("Message", "Title");
>> > textBox1.Text = "";
>> > textBox1.Enabled = false;
>> > textBox2.Enabled = true;
>> > textBox2.Text = "";
>> > textBox2.Focus();
>> > }
>> > -------------------------------------------------------
>> > When I debug, I have no message, I can see where the program is
>> > blocking.
>> > I think it's a problem between the MessageBox and the focus on
>> > "textBox2"
>> > field ?
>> >
>> > Thanks for any help.
>> >
>>
>>
>>
>>
>>