Hi
I write interactive worksheets for my students using VB programming. If they enter a string of text accurately, then the string turns green - excellent. I don't write from scratch, just copy and paste from an existing document and change the wording of the string. The problem I have is that the first box will work correctly, but most of the subsequent ones, will not recognise the first keystroke, so if they enter 'John likes to eat cake.' it appears as 'ohn likes to eat cake.'
I include a sample of the code that I use.
Private Sub TextBox2_Change ()
If TextBox2.Text = "I like to play computer games." Then TextBox2.ForeCo lor = &H8000& Else TextBox2.ForeCo lor = vbBlack
End Sub
Strangely, sometimes this does not happen, but I can see no reason why.
Jan
I write interactive worksheets for my students using VB programming. If they enter a string of text accurately, then the string turns green - excellent. I don't write from scratch, just copy and paste from an existing document and change the wording of the string. The problem I have is that the first box will work correctly, but most of the subsequent ones, will not recognise the first keystroke, so if they enter 'John likes to eat cake.' it appears as 'ohn likes to eat cake.'
I include a sample of the code that I use.
Private Sub TextBox2_Change ()
If TextBox2.Text = "I like to play computer games." Then TextBox2.ForeCo lor = &H8000& Else TextBox2.ForeCo lor = vbBlack
End Sub
Strangely, sometimes this does not happen, but I can see no reason why.
Jan
Comment