Tuesday, November 18, 2008

How to determine the .NET Compact Framework Version on the Device

Here is the best posting I have found to determine the version of the .NET Compact Framework on the device:

http://www.byteswired.com/2007/09/27/how-to-determine-compactframework-version/


The summary is that you look at the registry key:

HKLM\SOFTWARE\Microsoft\.NetCompactFramework

Tuesday, November 11, 2008

Determine OS version with .NET Compact Framework

If you are running a Device application and want to know (in the code) which platform you are running on (it could be CE.NET or Windows Mobile or various versions of each), then you can use:

Environment.OSVersion.Platform

For much more information and several examples, see:

http://www.christec.co.nz/blog/archives/77

Friday, November 7, 2008

Selecting all Items in a ListBox in VB.NET

It seems to me like there should be a method that would select or deselect all items in a listbox, but there is not. Here is a simple sub to accomplish this task:


Public Sub SelectAllListBoxItems(ByVal lv As ListBox, ByVal selected As Boolean)

For i As Integer = 0 To lv.Items.Count - 1

ListBoxValidations.SetSelected(i, selected)

Next

End Sub