Count words in a text box

kbutch
04-29-2005, 02:52 AM
Hi,

I'm wondering if its possible to count words in a string in a textbox in any given line.
eg. In the textbox, there are 2 lines.
Line 1: THis is line one
Line 2: this is the second line

so if I put the cursor on the 1st line I would get an answer = 4, 2nd line = 5 ...

Is it possible to count the words on each line? (One line at a time)

Thanks in Advance

Squirm
04-29-2005, 02:58 AM
You can use SendMessage with EM_GETLINE, Split the line, and then use UBound to get the number of words.

kbutch
04-29-2005, 04:32 AM
That worked
Thanks for your help.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum