This vb procedure allows only desired characters to be entered in Text Field.
special function need to be rewritten in xojo, as shown below,
Private Sub txtHdeg_KeyPress(KeyAscii As Integer)
If [b]KeyAscii[/b] = 47 Then
Select Case Len(TxtHdeg.text)
Case 1, 2, 4, 5
Case Else
KeyAscii = 0
End Select
Else
If InStr(1, "0123456789" & [b]Chr$(vbKeyBack) & Chr$(vbKeySpace), Chr$(KeyAscii)[/b]) = 0 Then
KeyAscii = 0
End If
End Sub
FUNCTION KeyDown(key as string) as Boolean
If AscB(key)=47 then
Select Case Len(TxtHdeg.text)
Case 1, 2, 4, 5
return false
Case Else
return true
End Select
Else
If InStr(1, "0123456789" + ChrB(8) + ChrB(32), key) = 0 Then
return false
End If
return true
End Function