Kail
asked on
Difference between Rich Text Box and Standard Text Box
Hi,
I'm writing a program where I'd like to have the user be able to click/double-click in a textbox, which will bring up a form. This new form queries the textbox about what text was clicked on.
I was using a normal textbox, and that was fine. I used the double-click event, and then queried SelText because words are highlighted when you double-click on them.
However, now I want to switch from a standard textbox to a richtextbox, and am running into some problems. Rich text boxes highlight text when you double-click them, but that seems to happen after the double_click event is processed, so when I query it, its blank unless I manually selected some text.
Anyone have any other ways on how to determine what word is being clicked on?
Thanks.
I'm writing a program where I'd like to have the user be able to click/double-click in a textbox, which will bring up a form. This new form queries the textbox about what text was clicked on.
I was using a normal textbox, and that was fine. I used the double-click event, and then queried SelText because words are highlighted when you double-click on them.
However, now I want to switch from a standard textbox to a richtextbox, and am running into some problems. Rich text boxes highlight text when you double-click them, but that seems to happen after the double_click event is processed, so when I query it, its blank unless I manually selected some text.
Anyone have any other ways on how to determine what word is being clicked on?
Thanks.
shur, you have the selstart of the text yes, and if so run a loop that adds on to this number and dose a mid on that ie
c=mid(text1.text,i,1) where i is the selstart + n which is the loop counter. then compare c tio chr(32) which is a space. When you have one stop looping and then start the loop in revirse ie -1 not plus 1 and when you get the next chr(34) you have the start of the word.
c=mid(text1.text,i,1) where i is the selstart + n which is the loop counter. then compare c tio chr(32) which is a space. When you have one stop looping and then start the loop in revirse ie -1 not plus 1 and when you get the next chr(34) you have the start of the word.
ASKER
That was a great idea Vbmaster. Please submit it as the answer so I can give you the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ps. Just make sure to set m_DoubleClick = False when you're done. ;)