Click here to Skip to main content
13,200,729 members (53,158 online)
Rate this:
Please Sign up or sign in to vote.
See more:

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 5-Jul-12 7:04am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171020.1 | Last Updated 6 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100