recognize  
Author Message
DRoden





PostPosted: Notebook, Tablet PC, and UMPC Development, recognize Top

im trying to get the ink to recogznie as soon as the inkedit loses focus or the pen moves off it..

what am i doing wrong

Thanks,

Dan

Public Sub PopInkEdit(ByVal sender As Object, ByVal e As EventArgs)

AddHandler GlobalInkEdit.MouseLeave, AddressOf disposeInkEdit

AddHandler GlobalInkEdit.LostFocus, AddressOf disposeInkEdit

End Sub

Public Sub disposeInkEdit(ByVal sender As Object, ByVal e As EventArgs)

GlobalInkEdit.Recognize()

ctrl1.text = globalinkedit.text

End Sub



Software Development for Windows Vista17  
 
 
Stefan Wick - MSFT





PostPosted: Notebook, Tablet PC, and UMPC Development, recognize Top

Hello DRoden,

you have to wait until the TextChanged event has happened before grabbing the new Text from the InkEdit control after you have called Recognize().

You can put something like this in your Leave/LostFocus/MouseLeave event handler:

If inkEd.Status = InkEditStatus.Recognizing Then
textChanged = False
inkEd.Recognize()
While (textChanged = False)
Application.DoEvents()
End While
ctrl1.Text = inkEd.Text
End If

And then add a TextChanged event handler that sets the gloabl textChanged flag to true:

Private Sub inkEd_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles inkEd.TextChanged
textChanged = True
End Sub

Thanks, Stefan Wick