C#怎么一行一行的读取richtextbox内容?
一个Timer。一个richtextbox。一个text。一个richtextbox里面有多行文本,时钟周期是10秒,每十秒读取一行richtextbox的一行内容添加到...
一个Timer。一个richtextbox。一个text。一个richtextbox里面有多行文本,时钟周期是10秒,每十秒读取一行richtextbox的一行内容添加到TEXTBOX里面。就像桌面显示歌词一样。怎么实现?大神们?
展开
展开全部
代码如下:
Public Class Form1
Public i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim counter As Integer
Dim tempArray() As String
tempArray = RichTextBox1.Lines
For counter = 0 To tempArray.GetUpperBound(0)
Console.WriteLine(tempArray(counter))
Next
If (i < counter) Then
Label1.Text = RichTextBox1.Lines(i)
Else
If (i = counter) Then
i = 0
End If
End If
i = i + 1
End Sub
End Class
Public Class Form1
Public i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim counter As Integer
Dim tempArray() As String
tempArray = RichTextBox1.Lines
For counter = 0 To tempArray.GetUpperBound(0)
Console.WriteLine(tempArray(counter))
Next
If (i < counter) Then
Label1.Text = RichTextBox1.Lines(i)
Else
If (i = counter) Then
i = 0
End If
End If
i = i + 1
End Sub
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询