Richtextbox选择句子 [英] Richtextbox select sentence

查看:89
本文介绍了Richtextbox选择句子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在vb.net中选择句子时遇到麻烦.
我想要的是,将文本放入主文本区域,然后单击下一步按钮>>".它将选择下一个句子,依此类推....与上一个按钮相同,它将选择上一个句子.请考虑将DOT(.)用作句子停止器.

请尽快帮助我.

感谢所有人.


问候
Kapil

Hello All,

I am getting trouble in sentence selection in vb.net.
What I want to is that, I put the text into the main text area and when I click on next button ">>" it will select the next sentence and so on.... Same for the previous button it will select the previous sentence. Please consider the DOT (.) as the sentence stopper.

Please help me ASAP.

Thanks to All.


Regards
Kapil

推荐答案

而不是提供代码,我将提出建议.最好是边做边学,而不要照搬.

使用Find()和FindNext()找到句点,然后选择文本

这是RichTextBox方法.您可以使用很多很棒的东西.
http://msdn.microsoft.com/en-us/library/system. windows.forms.richtextbox_methods.aspx [ ^ ]

一些示例代码,以防万一.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=146 [ ^ ]

CP中的好东西:
http://www.codeproject.com/search.aspx?q = Search + and + Highlight + Text + in + a + RichTextBox&sbo = kw [
Rather than provide code I am going to make a suggestion. It is better to learn by doing than by copying.

Use the Find() and FindNext() to locate the periods, Then select the text

Here are the RichTextBox Methods. Lots of cool stuff that you can use.
http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox_methods.aspx[^]

Some Sample code, just in case.
http://www.dotnetcurry.com/ShowArticle.aspx?ID=146[^]

And good stuff right here in CP:
http://www.codeproject.com/search.aspx?q=Search+and+Highlight+Text+in+a+RichTextBox&sbo=kw[^]

Regards


<br />
RichTextBox rtb = new RichTextBox();<br />
TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);<br />
tr.Select(rtb.Document.Blocks.FirstBlock.ContentStart, rtb.Document.Blocks.FirstBlock.ContentEnd);<br />



查看其他链接
链接1 [ ^ ]
链接2 [



see other links
Link1[^]
Link2[^]


这篇关于Richtextbox选择句子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆