I got email today asking me how to get the device ID from a pocket pc with vb Imports System.Text
Public Class Form1
<System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As Integer
End Function
Private Function GetDeviceId(ByVal appData As String) As Byte()
Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
Dim outputSize As Integer = 20
...
One of the things I miss from the Windows Forms DataGrid is the ability to have the rows alternating in color. For this example I created a custom DataGridTextBox column which will display each other row in an different color. Basically I override the paint method to call the existing paint method with a different back color brush for every other column.
Public Class AltColorColumn
Inherits DataGridTextBoxColumn
Private m_AltColor As Color
Public Property AltColor() As Color
Get
Return m_AltColor
End Get
Set(ByVal value As Color)
m_AltColor = value
End Set
End Property
Protected Overrides Sub...
Recently I got a new windows mobile 6 Pocket PC phone. The datagrid provided in the Compact Framework is a very limited version of the Windows Forms DataGrid. Here is an example which will format the output of a datagrid. The windows forms datagrid has a GetColumnAtRow which you can override to return the formatted data. In the compact framework version you need to override the paint method to draw the formatted data in the datagrid. Note use the columns PropertyDescriptor's GetValue method to get the cells value. For this example I created a new column which converts true false...