Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Hi,

I have written a Windows CE application in VB.Net (Visual Studio 2008), but am having a huge problem getting the forms to scale to fit on devices with different size and resolution screens. I have spent days reading articles on the web, but every time I think I understand "auto-scale" and "dock" and "anchor", it fails to work when I deploy the application to another device.

I've also run into a really strange issue, where in the "form load" event the form's height and width (me.height and me.width) show as 640x480, but once the form is painted they change to 480x640. There's no issue with screen orientation, and I've discovered that the screen bounds are always correct, but me.height and me.width are the wrong way around. I suspect this is potentially adding to my problems scaling the form, although am not sure if it's the direct cause or not!

Could anybody upload a really simple VB application, with a single control (e.g. a button), which auto-scales to whatever size and resolution screen Windows CE (or derivative such as Windows Mobile) is being used. If I could see some simple VB code (rather than reading lengthy articles and trying to unpick C# code that I don't understand!) I think it would really help me

Many thanks
Posted

1 solution

Please see my previous answer to somewhat similar question:
Make auto flexible dekstop application in .net4.0[^].

—SA
 
Share this answer
 
Comments
Member 9147178 6-Jul-12 4:42am    
Hi Sergey,

Thanks for the posting, but I'm still a bit lost. I've read many of these articles previously, but I'm obviously missing something as I cannot get anything to scale correctly. I'm also never quite sure which screen resolution to choose for development, or whether the Visual Studio IDE Designer is adding the correct statements (such as Me.AutoScaleDimensions = New System.Drawing.SizeF(96.0!, 96.0!) and Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi)

If there's anyone out there that can post an absolute idiot's guide, or some sample code, I would be very grateful
Member 9147178 6-Jul-12 4:52am    
One other thing. I'm not sure which platform or screen resolution I should be developing against. When I create a Smart Device project in Visual Studio 2008, it asks me for the Target Platform. My options are:
1. Pocket PC 2003
2. Windows CE
3. Windows Mobile 5.0 Pocket PC SDK
4. Windows Mobile 5.0 Smartphone SDK
5. Windows Mobile 6 Professional SDK

However, once the project is created I can then choose various Target Platforms, including various screen resolutions for Pocket PC, Windows Mobile 5 and Windows Mobile 6, and I can also choose whether to deploy to the device itself, or to an emulator. I also have a Windows CE Device option to deploy to, but there is no Windows CE Emulator option. I'm not sure which of these I'm best to use for my development. I thought that Windows Mobile was built on top of Windows CE, so I'm confused as to why this is proving SO difficult for me

Any advice much appreciated. The functionality in my VB application is coming on very quickly, but I've been unable to make any progress at all on the scaling issue meaning that the screens are almost unusable on anything other than one particular screen type.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900