-2

When I run this program the button for tokenize is not working I don't know why? Is there any changes?

Private Sub Tokenize_Click()       
    Dim tok As New Tokenizer      
    Dim s As String      

    tok.init txString.Text  
    lsTokens.Clear          
    s = tok.nextToken       

    While Len(s)>0        
        lsTokens.AddItem s    
        s = tok.nextToken     
    Wend
End Sub
MatSnow
  • 7,357
  • 3
  • 19
  • 31

1 Answers1

0

'You missed (Handles) at the end of the first line of the code (Change it like this):

Private Sub Tokenize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Tokenize.Click                   
Yasin Patel
  • 5,624
  • 8
  • 31
  • 53
  • There is no `Handles` in VBA. I'm waiting for the OP to figure out if they are trying to translate from VBA to VB.NET or if they are trying to write in VBA. Also, the tag [tag:stringtokenizer] is for a particular Java class. – Andrew Morton Feb 12 '18 at 10:05
  • OK, Change the title Because you are asking for VBA not VB.net. – Hussain Abbas Feb 15 '18 at 08:28