Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've searched everywhere for this and cannot find a correct answer.

Background:

I have 2 forms:

  • 'Form1' as the main form
  • 'InkPad' as a secondary form

 

I launched InkPad by:

Dim you as new InkPad
you.show()

 

Now I am using a Tablet PC and it has the Ink recognition defined my Microsoft.Ink. In the form InkPad, I have a groupbox which is selected as the Ink object so I can write in it. When I click a button called "translate" I want it to recognize the ink and change it to plain text and put it in a rich text box inside Form1 called 'rtxtComments'.

 

Problem:

It's not working correctly.

 

Here is what I have:

 Private Sub cmdTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTranslate.Click
       If 0 = myRecognizers.Count Then
           MessageBox.Show("There are no handwriting recognizers installed.  You need to have at least one in order to run this sample.")
       Else
           Dim objCont As Form1
           objCont.rtxtComments.SelectedText = myInkCollector.Ink.Strokes.ToString

           If Not myInkCollector.CollectingInk Then

               myInkCollector.Ink.DeleteStrokes(myInkCollector.Ink.Strokes)
               gbInkPad.Refresh()

           End If
       End If
   End Sub

 

Now the Ink Recognition itself works. But it won't put the recognized text into the rich text box. Anyone have any ideas?

  • Leaders
Posted

in Form1 :

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim you As New InkPad()
       Me.AddOwnedForm(you) '/// add this line.
       you.Show()
   End Sub

in the form " InkPad "

   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim objCont As Form1 = Me.Owner '/// add = Me.Owner
       objCont.rtxtComments.SelectedText = "some text from me to Form1!"
   End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...