[2005] cant show text in richtextbox
hello!
I've been trying to get this into a textbox but it don't seem to work. Prehaps you have a explanation.
Code:
g g ø g ð g è g à g Ø g Ð g È
g À g ¸ g ° g ¨ g gdf
g
dfg
ergreger
ger
ger
g
erg
er
g ˜
(note a key dont get into this box and i belive it is a chr(0) )
and dont say "use richtextbox.loadfile(file) becouse i have already tried that. And a streamreader.
i have tried to get rid of the chr(0) many times too.
And when i update my richtextbox very fast i seem to get more letters into it.
Re: [2005] cant show text in richtextbox
What is the problem? It also helps if you show your code.
Re: [2005] cant show text in richtextbox
Explain your question clearly.
Specifically -
"and dont say "use richtextbox.loadfile(file) becouse i have already tried that."
Okay, and why didn't that work? Because I just copied your text, put it in a text file and loaded it just like this.
"And a streamreader."
And what about a StreamReader?
"And when i update my richtextbox very fast i seem to get more letters into it."
Huh?
Re: [2005] cant show text in richtextbox
Ok.
I am trying to convert a old vb6 program to my new vb 2005 program.
The problem is that i have the code from him but i cant give the code out that is why i am going to have a hard time explaining.
But first i need to get some text in my richtextbox
But the richtextbox dose'nt accept the textfile and just give me the first post of it (the first 500 letters before Chr(0)) and i am wondering how to get the whole textfile instead of just g
i have olso tried a streamreader to solve the problem without success...
Re: [2005] cant show text in richtextbox
I copied the text from your first post and got 6590 characters in the RichTextBox. :ehh:
vb.net Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.RichTextBox1.LoadFile("c:\test.txt", RichTextBoxStreamType.PlainText)
MessageBox.Show(Me.RichTextBox1.Text.Length.ToString())
End Sub
Re: [2005] cant show text in richtextbox
i said in the first post that Chr(0) isnt displayed on the site so the reason must be that..
*edit* Umm... is there a difference between me.richtextbox.text and richtextbox.text because it seemed to work this time :S
Re: [2005] cant show text in richtextbox
Quote:
Originally Posted by hallongodis
*edit* Umm... is there a difference between me.richtextbox.text and richtextbox.text because it seemed to work this time :S
There is no difference. But I always use the Me keyword as it makes it clear that you are referring to the current instance of a class and you get Intellisense after just 3 characters. :thumb:
Re: [RESOLVED] [2005] cant show text in richtextbox
:S strange how did it magicaly work when i typed me.richtextbox when it completly denied my old code
Re: [RESOLVED] [2005] cant show text in richtextbox
Possibly because you named your RichTextBox richtextbox? I don't know. At any rate I'd avoid naming your controls the actual class name.
Re: [RESOLVED] [2005] cant show text in richtextbox
oh and now i am trying to put that text form richtextbox.text to richtextbox2.text and for each 500 chars it should move onto a new line.
my code witch dont seem to work..
Code:
Me.Start.LoadFile(Application.StartupPath & "\adress.txt", RichTextBoxStreamType.PlainText)
Me.Start.SaveFile(Application.StartupPath & "\Adressbkup.txt", RichTextBoxStreamType.PlainText)
Dim m As String
Dim i As Integer
Dim i2 As Integer
Dim i3 As Integer
Dim testing As String
i2 = 1
For i2 = 0 To Start.Lines.LongLength
If Slut.Text = "" Then
i3 = 0
i = i + 500
m = Start.Text.Trim.Substring(i3, i)
testing = Slut.Text()
Slut.Text = m
i = i + 500
Else
i3 = i3 + 500
i = i + 500
testing = Slut.Text & ControlChars.Lf
Slut.Text = testing
m = Start.Text.Trim.Substring(i3, i)
Slut.Text = m
End If
Next i2