473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

RichTextBox lines setValue not updating!

I am having trouble updating lines in a richtextbox. The rtb.lines.setvalue("text", linenumber) runs, but does not update the control in the form. The code follows...
This apps automatically updates an output screen with changes in the file when the file length changes..

Private Sub LoadFile()
Dim lineCount As Integer = 0
Dim line As String
Dim iLength As Integer

If File.Exists(gFile) Then
Dim fs As New FileStream(gFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
iLength = fs.Length
If iLength <> saveLength Then
Dim sr As StreamReader = New StreamReader(fs)
While sr.Peek >= 0
line = sr.ReadLine
If lineCount < slineCount Then
If line <> rtbOutPut.Lines.GetValue(lineCount) Then
PROBLEM CODE -> rtbOutPut.Lines.SetValue("line", lineCount)
End If
Else
rtbOutPut.AppendText(line & vbNewLine)
End If
lineCount = lineCount + 1
End While
slineCount = lineCount - 1
saveLength = iLength
sr.Close()
End If
fs.Close()
Else
saveLength = -1
End If
End Sub
--------------------------------
From: OmniTech

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>pq0K6G2LZkK62PP9e92Jsw==</Id>
Nov 20 '05 #1
0 2623

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas Kehl | last post by:
Hi! I have a RichTextBox. I set the Property RightMargin of this Box to a value, that i will not show the horizontal scrollbar. Now, the RichTextBox Wrap the Lines automatically. Now I would...
10
by: D Steward | last post by:
I can't seem to add a newline (/n) to get a richtextbox control to display text on successive lines. The text that I type is overwritten. How do I remedy this My example richTextBox->Multiline...
4
by: M O J O | last post by:
Hi, I'm using a RichTextBox with WordWrap=True and MultiLine=False. When the text is to long, it fills more lines. How do I get the number of lines the text uses? Thanks!
2
by: JonnyT | last post by:
I searched high and low for an answer on how to auto scroll a richtextbox and now I finally have it. Since it took me a while to get a good efficient way of doing it that didn't require focus to...
4
by: Franky | last post by:
What I want to do is delete the last line in a RichTextBox. The RichTextBox has a ReadOnly property called lines that seems like it might help but I cant figure out how to use it. Well, the...
2
by: =?Utf-8?B?ZG1idXNv?= | last post by:
I am filling a richtextbox via the AppendText method and it works great. However, I would like to to off screen updating, add my 50 or so lines to the richtextbox, and then turn screen updating...
1
by: kelvin.koogan | last post by:
I am trying to do an operation where I find and highlight all instances of a string in a RichTextBox. E.g. pMatchesFound = Regex::Matches(pRichTextBox->Text, pStr, options); for (int i = 0; i...
2
by: macky caliston | last post by:
Hi, Im having problems with the value being returned by the richtextbox.GetLineFromCharIndex method. Its returning a value that is more than the richtextbox.Lines.Length. Im trying to print...
4
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a multiline RichTextBox that I use for data logging. I'm concerned about how the AppendText method reacts when over time the maximum number of characters have been added. Do the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.