recognize
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
PublicSub PopInkEdit(ByVal senderAsObject,ByVal eAs EventArgs)
AddHandler GlobalInkEdit.MouseLeave,AddressOf disposeInkEditAddHandler GlobalInkEdit.LostFocus,AddressOf disposeInkEditEndSubPublicSub disposeInkEdit(ByVal senderAsObject,ByVal eAs EventArgs)GlobalInkEdit.Recognize()
ctrl1.text = globalinkedit.text
EndSub
[2134 byte] By [
DRoden] at [2008-2-27]
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 IfAnd 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 SubThanks, Stefan Wick