Link to home
Start Free TrialLog in
Avatar of Kail
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.
Avatar of Vbmaster
Vbmaster

How about setting the global variable m_DoubleClick = True in the DoubleClick event and show the form from the MouseUp event (if the m_DoubleClick variable is True)?

ps. Just make sure to set m_DoubleClick = False when you're done. ;)
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.
Avatar of Kail

ASKER

That was a great idea Vbmaster.  Please submit it as the answer so I can give you the points.
ASKER CERTIFIED SOLUTION
Avatar of Vbmaster
Vbmaster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial