Ahmadreza's Notes

On Software Development

Posts Tagged ‘Windows Mobile

How to change mouse cursor icon in windows mobile application

Informing user about application state is one of important aspects in user experience. In windows applications mouse icon indicates one of great application states. When an application is busy mouse icon should be changed to wait cursor mode or hourglass icon. In windows application you can achieve this by changing Cursor property of any Control, Usually by changing “this.Cursor” which “this” is current form in application. See example:


this.Cursor = Cursors.WaitCursor;


Since control class in compact framework does not have Cursor property, not only developer could not change every control cursor icon but also he could not change form cursor property. So what should developer do in order to indicate application state?

There is a static class in System.Windows.Forms named Cursor and it has a property named “Current” which developer should set it to an appropriate cursor based on application state.



System.Windows.Forms.Cursor = Cursors.WaitCursor;


System.Windows.Forms.Cursor = Cursors.Default;


Written by Ahmadreza Atighechi

April 6, 2009 at 12:28 pm

Posted in Blog

Tagged with ,

TickCount instead of millisecond in compact framework

After long absence I’m back now. Recently I wanted to develop an application for windows mobile with .Net Compact framework. In this application I need to measure elapsed time in millisecond resolution. First of all like everyone I tried to use Millisecond property of DateTime.Now static class. But it won’t work at all in .Net Compact framework even in version 3.5!

If you want to use a timer with millisecond resolution you have to use TickCount property of Environment class.

//Will be zero.

lblMillisecondVal.Text = DateTime.Now.Millisecond.ToString();

//Total milliseconds elapsed since the system started.

lblTickCountVal.Text = Environment.TickCount.ToString();

Here is an example of using TickCount Instead of Milliseconds

Written by Ahmadreza Atighechi

March 30, 2009 at 1:42 pm

Posted in Blog

Tagged with ,

Pocket PC Developers Resources

Currently, I’m working on Pocket PC development. During last week I’ve found interesting resources about windows mobile development with .Net compact framework. first of all Windows Mobile Team Blog would be a sophisticated resource. Moreover you could find other useful links in this weblog.

Other blogger’s web site would be good resources, like Chris Craft’s Blog. CJ’s weblog contains a series of posts for a month. For each day he wrote a post about windows mobile programming. It would be a good starting tutorial for beginners.

Another web site that could be useful is www.dotnetfordevices.com .

However, I’ll post related news and experiences during windows mobile development

Written by Ahmadreza Atighechi

October 28, 2008 at 12:07 am

Posted in Blog

Tagged with ,