Friday, September 30, 2011

Windows mobile application closing and navigation tutorial

Mobile devices always have one application in the foreground. So navigation to another application or another section of the same application is very important when you are developing for a mobile device.

  • Mobile devices doesn't care about closing applications. It only cares about switching between applications and application components in a quick and easy manner.

  • Minimizing the application will give faster response time between application switches. Operating system must take care of the termination of application when the system is running out of memory. Minimize option can be implemented by setting the following properties of the Form we are displaying.
Form.ControlBox = True;
Form.MinimizeBox = True;

  • Closing the application will allow the user to control the application life-cycle on his own. Operating system has less work to do comparing to the minimize option. This option can be implemented by setting the following properties.
 Form.ControlBox = True;
 Form.MinimizeBox = False;

We can remove both these options and eventually remove the entire control box by setting the following property.

Form.ControlBox = False;

If we set this option, then there should be a way to navigate away from this form. For that we can use a button to navigate to another form by implementing one of the two methods mentioned below for the button click event. 


Form.ShowDialog - This method will show the second Form and waits until that form is closed (Blocking Call) before executing the first Form's code.

Form.Show - This method will show the second form and continue the first Form's code without caring about the second Form's activities (Non - Blocking call) 









No comments:

Post a Comment