PC Review


Reply
Thread Tools Rate Thread

WaitCursor shows only for a moment

 
 
maluman
Guest
Posts: n/a
 
      16th Mar 2005
Hello

I am trying to get control over how the cursor looks, and my attempts
failed. If anyone could please help me.
I made a clock count, and the cursor shows only for a moment on my
Windows CE 4.2 device (Psion Workabout PRO). On emulator you'll probably
find, that moving mouse causes cursor to go back to default state. This
source assumes, that you have a button with text "START" on the form and
a timer:

void button1_Click(object sender, System.EventArgs e)
{
if (timer1.Enabled)
{
Cursor.Current = Cursors.Default;
timer1.Enabled = false;
button1.Text = "START";
}
else
{
button1.Text = "STOP";
Cursor.Current = Cursors.WaitCursor;
timer1.Interval = 3000; // 3 seconds for a cursor to appear
timer1.Enabled = true;
}
}

private void timer1_Tick(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.Default;
timer1.Enabled = false;
button1.Text = "START";
}

--
Regards, m.
 
Reply With Quote
 
 
 
 
Darren Shaffer
Guest
Posts: n/a
 
      17th Mar 2005
When you enable the timer, it runs on a different thread than the main UI
thread that the WaitCursor is running on. Suggest you look at the sample
Compact Framework splash screen app on MSDN to understand how to
work with the UI when separate threads are involved under CF.

http://msdn.microsoft.com/library/de...ml/casoast.asp
--
Darren Shaffer
Principal Architect
Connected Innovation

"maluman" <(E-Mail Removed)> wrote in message
news:d19bhk$pks$(E-Mail Removed)...
> Hello
>
> I am trying to get control over how the cursor looks, and my attempts
> failed. If anyone could please help me.
> I made a clock count, and the cursor shows only for a moment on my
> Windows CE 4.2 device (Psion Workabout PRO). On emulator you'll probably
> find, that moving mouse causes cursor to go back to default state. This
> source assumes, that you have a button with text "START" on the form and
> a timer:
>
> void button1_Click(object sender, System.EventArgs e)
> {
> if (timer1.Enabled)
> {
> Cursor.Current = Cursors.Default;
> timer1.Enabled = false;
> button1.Text = "START";
> }
> else
> {
> button1.Text = "STOP";
> Cursor.Current = Cursors.WaitCursor;
> timer1.Interval = 3000; // 3 seconds for a cursor to appear
> timer1.Enabled = true;
> }
> }
>
> private void timer1_Tick(object sender, System.EventArgs e)
> {
> Cursor.Current = Cursors.Default;
> timer1.Enabled = false;
> button1.Text = "START";
> }
>
> --
> Regards, m.



 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      17th Mar 2005
> When you enable the timer, it runs on a different thread than the main UI
That is true for threading timers. Isn't the OP using a Forms timer?

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Darren Shaffer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When you enable the timer, it runs on a different thread than the main UI
> thread that the WaitCursor is running on. Suggest you look at the sample
> Compact Framework splash screen app on MSDN to understand how to
> work with the UI when separate threads are involved under CF.
>
> http://msdn.microsoft.com/library/de...ml/casoast.asp
> --
> Darren Shaffer
> Principal Architect
> Connected Innovation
>
> "maluman" <(E-Mail Removed)> wrote in message
> news:d19bhk$pks$(E-Mail Removed)...
>> Hello
>>
>> I am trying to get control over how the cursor looks, and my attempts
>> failed. If anyone could please help me.
>> I made a clock count, and the cursor shows only for a moment on my
>> Windows CE 4.2 device (Psion Workabout PRO). On emulator you'll probably
>> find, that moving mouse causes cursor to go back to default state. This
>> source assumes, that you have a button with text "START" on the form and
>> a timer:
>>
>> void button1_Click(object sender, System.EventArgs e)
>> {
>> if (timer1.Enabled)
>> {
>> Cursor.Current = Cursors.Default;
>> timer1.Enabled = false;
>> button1.Text = "START";
>> }
>> else
>> {
>> button1.Text = "STOP";
>> Cursor.Current = Cursors.WaitCursor;
>> timer1.Interval = 3000; // 3 seconds for a cursor to appear
>> timer1.Enabled = true;
>> }
>> }
>>
>> private void timer1_Tick(object sender, System.EventArgs e)
>> {
>> Cursor.Current = Cursors.Default;
>> timer1.Enabled = false;
>> button1.Text = "START";
>> }
>>
>> --
>> Regards, m.

>
>


 
Reply With Quote
 
Darren Shaffer
Guest
Posts: n/a
 
      17th Mar 2005
You're right Daniel - good catch - I just finished writing a windows service
for
a project using threading timers and had that on my brain when I saw his
question.

Maluman - I just tried your code on two devices and I get the wait cursor
for
3 seconds just as you expected. Dell Axim X50v CF 1 SP3 and iPaq 4355 CF2
both display same behavior. So it *should* work for you - what level of
the CF are you using? Is there anything else running on your device as
you are testing?
--
Darren Shaffer
Principal Architect
Connected Innovation

"Daniel Moth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> When you enable the timer, it runs on a different thread than the main UI

> That is true for threading timers. Isn't the OP using a Forms timer?
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "Darren Shaffer" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> When you enable the timer, it runs on a different thread than the main UI
>> thread that the WaitCursor is running on. Suggest you look at the sample
>> Compact Framework splash screen app on MSDN to understand how to
>> work with the UI when separate threads are involved under CF.
>>
>> http://msdn.microsoft.com/library/de...ml/casoast.asp
>> --
>> Darren Shaffer
>> Principal Architect
>> Connected Innovation
>>
>> "maluman" <(E-Mail Removed)> wrote in message
>> news:d19bhk$pks$(E-Mail Removed)...
>>> Hello
>>>
>>> I am trying to get control over how the cursor looks, and my attempts
>>> failed. If anyone could please help me.
>>> I made a clock count, and the cursor shows only for a moment on my
>>> Windows CE 4.2 device (Psion Workabout PRO). On emulator you'll probably
>>> find, that moving mouse causes cursor to go back to default state. This
>>> source assumes, that you have a button with text "START" on the form and
>>> a timer:
>>>
>>> void button1_Click(object sender, System.EventArgs e)
>>> {
>>> if (timer1.Enabled)
>>> {
>>> Cursor.Current = Cursors.Default;
>>> timer1.Enabled = false;
>>> button1.Text = "START";
>>> }
>>> else
>>> {
>>> button1.Text = "STOP";
>>> Cursor.Current = Cursors.WaitCursor;
>>> timer1.Interval = 3000; // 3 seconds for a cursor to appear
>>> timer1.Enabled = true;
>>> }
>>> }
>>>
>>> private void timer1_Tick(object sender, System.EventArgs e)
>>> {
>>> Cursor.Current = Cursors.Default;
>>> timer1.Enabled = false;
>>> button1.Text = "START";
>>> }
>>>
>>> --
>>> Regards, m.

>>
>>

>



 
Reply With Quote
 
maluman
Guest
Posts: n/a
 
      18th Mar 2005
> Dell Axim X50v CF 1 SP3 and iPaq 4355 CF2
> both display same behavior. So it *should* work for you - what level of
> the CF are you using? Is there anything else running on your device as
> you are testing?


I have CF1 SP3.

I have a several background processes. Looking into CE Remote Process
Viewer:

nk.exe
filesys.exe
device.exe
gwes.exe
services.exe
explorer.exe
ConManClient.exe
repllog.exe
rapisrv.exe
udp2tcp.exe
rnaapp.exe
cemgrc.exe
cepwcli.exe
MyApp.exe - my application

I also noticed, that when I set breakpoints at lines, where I do:
Cursor.Current = Cursors.Default;

The program doesn't reach those lines in less time than timer ticks, and
the cursor still behaves in the way I described. It shows only for a moment.

Regards, maluman.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ProgressBar or WaitCursor PK Microsoft Dot NET Framework Forms 1 15th Feb 2008 09:06 AM
Cursors.WaitCursor =?Utf-8?B?bWdvbnphbGVzMw==?= Microsoft C# .NET 1 26th Feb 2007 11:39 PM
What's the difference between Cursor = Cursors.WaitCursor and CurrentCursor=Cursors.WaitCursor Just Me Microsoft VB .NET 10 24th Mar 2005 03:57 PM
WaitCursor not showing, again =?Utf-8?B?U3RlcGhlbiBTaGlo?= Microsoft Dot NET Framework Forms 0 23rd Apr 2004 12:56 AM
WaitCursor Shwe Man Thar Microsoft Dot NET Compact Framework 0 2nd Dec 2003 11:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:44 PM.