WaitCursor shows only for a moment

M

maluman

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";
}
 
D

Daniel Moth

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
 
D

Darren Shaffer

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?
 
M

maluman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top