获取richtextbox控件中所选文本的位置.. [英] get the location of selected text in a richtextbox control..
本文介绍了获取richtextbox控件中所选文本的位置..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以请给我一个代码来演示我们如何在richtextbox控件中找到当前所选文本(任何位置,中间,左或右)的位置??
i需要在具有某些同义词选项的位置显示列表框。列表框在应用程序启动时不可见。只有当用户从richtextbox中选择一个单词时,才能在当前所选文本位置显示列表框。
can anybody please provide me a code to demonstrate how we can locate the position of the currently selected text (any position, middle, left or right) in a richtextbox control??
i need to show a listbox at the position with some synonyms option. the listbox is invisible at start of application. only when user selects a word from richtextbox should the listbox be shown at the current selected text location.
推荐答案
本文 [ ^ ]可能会帮助您找到x,y点。如果没有,请尝试这些谷歌搜索结果。 [ ^ ]
This article[^] might help you find the x,y point. If not try these google results.[^]
你应该在发布之前尝试谷歌你的问题。
Dim intPosition as Integer = txtRichtextbox .SelectionStart
但听起来你只想要所选的文字:
Dim strSelectedText as String = txtRichtextbox.SelectedText
You should try to google your questions before posting.
Dim intPosition as Integer = txtRichtextbox.SelectionStart
but it sounds like you reall just want the selected text:
Dim strSelectedText as String = txtRichtextbox.SelectedText
这篇关于获取richtextbox控件中所选文本的位置..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文