bug loox 720 or opennetcf?

  • Thread starter Thread starter wavemill
  • Start date Start date
W

wavemill

Hello!

This is my problem.

I create a button image:
OpenNETCF.Windows.Forms.ButtonEx myButton = new
OpenNETCF.Windows.Forms.ButtonEx();
myButton.Size = new Size(200, 50);
myButton.Location = new Point(30, 100);
Bitmap bmp = new Bitmap(@"\Program Files\appxpbutton\Button.png");
myButton.BackgroundImage = bmp;
this.Controls.Add(myButton);

It's a simple button just for a sample.
When i run the program on my emulator and my hw6515, there is no problem
but on my fujitsu loox 720, my button has not the right size, he is very
small.
I don't know why?
I work on vs2005, cf v2, installed on my loox 720.

If you have any idea!

Thank you!

Wavemill
 
It sounds to me like the button is not being properly resized for the VGA
screen on the Loox 720. When you create your controls at runtime the CF2.0
does not automatically resize the runtime controls as it does with the
designer added controls, even though AutoScaleMode is set to dpi. You
should check the dpi settings before you create the controls and size the
control accordingly, so for example:

Single yScaleFac = (Single)(Me.AutoScaleDimensions.Height / 96.0, Single);
Single xScaleFac = (Single)(Me.AutoScaleDimensions.Width / 96.0);
myButton.Size = new Size((int)(200*xScaleFac), (int)(50*yScaleFac));
 
Thank you for your answer!
you are right, it's ok now!

but it's a problem, it's a lot of work. I must rewrite a lot of code...

Thank you again for your help!

Wavemill
 
Back
Top