[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Difference between Rich Text Box and Standard Text Box


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?

  • 2
1 Solution
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.
KailAuthor Commented:
That was a great idea Vbmaster.  Please submit it as the answer so I can give you the points.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now