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 disposeInkEdit

AddHandler GlobalInkEdit.LostFocus,AddressOf disposeInkEdit

EndSub

PublicSub disposeInkEdit(ByVal senderAsObject,ByVal eAs EventArgs)

GlobalInkEdit.Recognize()

ctrl1.text = globalinkedit.text

EndSub

[2134 byte] By [DRoden] at [2008-2-27]
# 1

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

StefanWick-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Notebook, Tablet PC, and UMPC Development...

Software Development for Windows Vista

Site Classified