CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Mobile devices with a VGA display

In my previous post I talked a little on make your apps work on a 240*240 display size. On the other side of the spectrum are huge PDA's with a VGA (640*480) display. CF 2 applications adapt to these screens automatically using two properties of the form. But a converted CF 1 app looks awful on such a device. To repair this you have to set these properties by hand. They are set in the InitializeComponent  method of the form

this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;

The autoscalemode in a converted app has the value of AutoScaleMode.Inherited. After setting it to AutoScaleMode.Dpi you form looks great on a VGA screen. The AutoScaleDimensions give the form a reference size. In a new form this property is introduced by the designer.

On such a large screen the size of the SIP input panel is different as well. All reference documentation, including the logo requirements, mentions a height of 80 pixels for the SIP. Instead of hard coding that value as I did in the first post you can read the actual height and use that value..

private void inputPanel1_EnabledChanged((object sender, EventArgs

{

   if (inputPanel1.Enabled)

      panel1.Height -= inputPanel1.Bounds.Height;

   else

      panel1.Height += inputPanel1.Bounds.Height;

}

Now your app will work well on a small and on a big screen, including SIP support.


Published Aug 01 2006, 10:47 AM by pvanooijen
Filed under:

Check out Devlicio.us!