View Single Post
  #27 (permalink)  
Old 02-18-2009, 10:35 AM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Here's another way of adapting a QVGA app to VGA using the Door library. Visual Studio 2005 adds this code automatically to a form laid out for a QVGA device so that the form scales up when run on a VGA device. VS2005 also adds the same code, but with the 96s replaced by 192s, for a form laid out for a VGA device so it scales down when run on a QVGA device.

Obj1 and Obj2 are Door library objects. Args is a Door library ObjectArray.
Code:
    Obj1.FromControl("Form1")        
'Form1.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
Args.New1(2)
Args.SetValue(
096"System.Single")
Args.SetValue(
196"System.Single")
Obj2.CreateNew2(
"System.Drawing.SizeF" & Obj2.System_Drawing, Args.Value)        
Obj1.SetProperty2(
"AutoScaleDimensions", Obj2.Value)    
'Form1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;    
Obj1.SetProperty("AutoScaleMode""Dpi")    
'Form1.PerformAutoScale();
Obj1.RunMethod("PerformAutoScale")
Reply With Quote