very easy text box multiline questions

  • Thread starter Thread starter Antonio Policelli
  • Start date Start date
A

Antonio Policelli

hi, i have a datareader returning a 2 column recordset with multiple
rows what i want to display in a textbox. here is my code. only the
last line shows up in the text box but all gets written to the
console, so i know they are there. I have tried controlchars.crlf,
chr(13), vbcrlf, none worked. what did i do wrong? it is definitely
a multiline text box because at runtime i can type in multiple lines..

Do While drReader.Read
Console.WriteLine(drReader("qty").ToString & " " &
drReader("part").ToString)
Me.txtDetails.Text = drReader("qty").ToString & " " &
drReader("part").ToString & ControlChars.CrLf
Loop

thanks
AP!
 
Hi Antonio,

It is multiline, but you say in your program everytime

textbox1.text = String

While you did want to say something as

Textbox1.text = Textbox1.text & String

Now I show it you, you probably see it and thinks "stupid me" I did know
this
Happens to everybody sometimes.
:-))

There will maybe someone who tells you that you better can use
Stringbuilder, I don't give you that advise this time. Or you textboxes has
to contains every time more than 100 lines.

Than I would look for Stringbuilder, Stringbuilder it is much faster than
the code I showed above..

Cor
 
Back
Top