   End If
   
   ' If the user has initiated edit mode by a key, we want
   ' to add this to the text.  This is really a common
   ' thing and should probably be supported automatically
   ' in the grid:
   If Not (iKeyAscii = 0) Then
      sText = Chr$(iKeyAscii) &amp; sText
      txtEdit.Text = sText
      txtEdit.SelStart = 1
      txtEdit.SelLength = Len(sText)
   Else
      txtEdit.Text = sText
      txtEdit.SelStart = 0
      txtEdit.SelLength = Len(sText)
   End If
   
   ' Set the text properties to