RICHTEXTBOX LINES问题 [英] RICHTEXTBOX LINES PROBLEMS

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

问题描述

我想删除richtextbox的前两行文本条目

I want to delete the first two lines of text entries of a richtextbox

如果我们在richtextbox中至少有十个文本条目

if we have at least ten text entries in the richtextbox

但是我的代码无法正常工作

but my code does'nt work

这是我的代码

Dim lines As New List(Of String)(RichTextBox1.Lines)     

Dim lines As New List(Of String)(RichTextBox1.Lines)     

 如果lines.Count> 10然后     

  If lines.Count > 10 Then     

  lines.Remove(1)     

  lines.Remove(1)     

  lines.Remove(2)       

  lines.Remove(2)       

 结束如果


推荐答案


如果我们在richtextbox中至少有十个文本条目

if we have at least ten text entries in the richtextbox

但我的代码无效

在富文本框中可见的行可能与文本行不对应 - 一个是视觉显示,另一个取决于字符串中的字符。 您需要更详细地描述文本框中的文本实际上是
是什么以及您的意思是"不起作用"。 您是在处理显示的行还是在基础字符串中分隔的行?  Rich Text Box内容来自何处以及如何加载到RTB中?
'文字条目'是什么意思? 

The lines that are visible in a rich text box may not correspond to lines of text - one is a visual display and the other depends on the characters in the string.  You need  to describe in more detail what the text in the text box actually is and what exactly you mean by 'doesn't work'.  Are you dealing with lines as displayed or lines as delimited in the underlying string?  Where is the Rich Text Box content coming from and how is it being loaded into the RTB? What do you mean by 'text entries'? 


这篇关于RICHTEXTBOX LINES问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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