Monday, September 26, 2011

Controlling the Windows Form in Windows Mobile

With the introduction of Windows Forms 2.0, classes which inherited form windows forms class are separated into two separate files using the "partial" keyword. This has separated the User interface components and the control logic into two separate files named

  • form.designer.cs
  • form.cs 

respectively.Basic components of a windows form user interface are shown below.


Mobile device applications are normally run in full screen mode and programmer might need to customize the entire display area with his colors and themes. For doing this, he needs to tweak with the basic components of the UI Form.

Hiding the Title Bar
This can be done with setting the following property

Form.WindowState = Maximized

Hiding the Bottom Menu bar
This can be done by deleting the MainMenu control in the Form class.

Removing the Control Box in the top right hand corner
This control box is used control the form's minimzing and closing behavior. To remove this control from the Form, with the following setting

Form.ControlBox = false




Setting close and minimize buttons in the application


Small control box displayed in the top right corner of the window is used to minimize or close the application . If the control box contains the OK button, then application will be terminated after clicking that button. If it contains the cross sign (X), application will be minimized. setting the desired control can be done through the following property setting.

Form.MinimizeBox = False - This will enable the OK button and make the application exit when the button is clicked

Form.MinimizeBox = True - This will enable the X button and make the application minimize when the button is clicked























No comments:

Post a Comment