Categories
NETCF

.NETCF 3.5 Breaking Changes

I came across this useful list of breaking changes in the .NETCF 3.5 runtime and thought I’d blog it here before I lose the URL:- http://msdn.microsoft.com/en-us/netframework/bb986636.aspx

Categories
NETCF

Antialisasing and .NETCF

On the newsgroup, a developer asked if it was possible to use antialiasing on a Label font. By default on Windows Mobile the text does not use antialiasing unless you turn on the global ClearType option under Settings > System > Screen > ClearType. The platform has the capability to smooth fonts, we just need […]

Categories
NETCF

Exception Messages on .NETCF v3.5

Martijn Hoogendoorn provides a description of how to avoid the message:- “An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install ‘NETCFv35.Messages.EN.wm.cab’ for Windows Mobile 5.0 and above or  ‘NETCFv35.Messages.EN.cab’ for other platforms. Restart the application to see […]

Categories
How To NETCF

How To: Get System Power State Name and Flags

A question came up on our forums and so I investigated writing a wrapper for the GetSystemPowerState API function. This allows you to retrieve the power state name, and also a bitmask of flags – Is the backlight on, is the device password protected etc. This is the result in VB.NET. We will add it […]

Categories
How To NETCF

How To: Programmatically Scroll Controls

A number of controls within .NETCF have built in ScrollBars. Occasionally you may want to operate these programmatically on behalf of the user. When you do this you want both the control to scroll and the scrollbars to correctly reflect the current position. Faced with this requirement I found a solution in the WM_VSCROLL (and […]

Categories
NETCF

HttpWebRequest Exceptions under .NETCF

While testing code using HttpWebRequest it can be observed in the debug output that a number of exceptions are thrown within the GetResponse call of a HttpWebRequest. If you run exactly the same code on the desktop you don’t see this behaviour. For reference the following is a simple example which displays the issue:- System.Net.WebRequest […]

Categories
NETCF Windows Mobile

Determine Platform – .NETCF 3.5 and earlier

One of the new features in v3.5 of the Compact Framework is the ability to easily detect the platform you are running on from Smartphone (Standard Edition), PocketPC (Classic or Professional Editions) or WinCEGeneric (Everything else). The code is very straight-forward:- using Microsoft.WindowsCE.Forms;if(SystemSettings.Platform == WinCEPlatform.Smartphone){   //do something smartphone specific…}  In the latest (v3.0) version of Mobile […]

Categories
NETCF

New Networking Component

In The Hand Ltd today released Networking In The Hand, a developer library for the .NET Compact Framework 2.0 and 3.5 Beta. This library adds additional networking functionality not found in in the Compact Framework while matching the object model used in the full .NET framework to make it easy to share your code between […]

Categories
NETCF

System.Media.SoundPlayer versus the PlaySound API

In .NETCF v3.5 there is a new namespace – System.Media which brings audio support to the Compact Framework. Previously the common way to add sounds to your application was to use the PlaySound API (either P/Invoking yourself or using one of many wrappers). Now that the framework itself has built-in support, which matches the desktop […]

Categories
NETCF

Multiline Button

On the newsgroup somebody asked how to have multiple lines of text on a .NETCF Button control. The native control supports this but the appropriate style is not set by default. The following code snippet shows how to enable this:- private const int BS_MULTILINE = 0x00002000;private const int GWL_STYLE = -16;[System.Runtime.InteropServices.DllImport(“coredll”)]private static extern int GetWindowLong(IntPtr […]