tab function in a multiline text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When Iam doing the following:

TextBox19.Text &= objReq.Name & ControlChars.Tab
TextBox19.Text &= objReq.Number & ControlChars.Tab
TextBox19.Text &= objReq.Owner & ControlChars.NewLine


TextBox20.Text &= objReq.Name & ControlChars.Tab
TextBox20.Text &= objReq.IDNumber & ControlChars.Tab
TextBox20.Text &= objReq.Owner & ControlChars.NewLine

in text box 19 rows get printed well with proper tabs.

but in text box 20 first row does not get the first tab and then from 2nd
row it does fine.

Textbox19 looks like below:

tom 4565 john
alice 9090 sim

Textbox19 looks like below:

tom4565 john
alice 9090 sim

why wud that be??

Thank you !!
 
amruta said:
When Iam doing the following:

TextBox19.Text &= objReq.Name & ControlChars.Tab
TextBox19.Text &= objReq.Number & ControlChars.Tab
TextBox19.Text &= objReq.Owner & ControlChars.NewLine

BTW, if you're doing lots of string concatenation like the above, it's *far*
more efficient to do it all in one statement, as in

TextBox19.Text = TextBox19.Text _
& objReq.Name & ControlChars.Tab _
& objReq.Number & ControlChars.Tab _
& objReq.Owner & ControlChars.NewLine
but in text box 20 first row does not get the first tab and then from 2nd
row it does fine.
tom4565 john
alice 9090 sim

Are both textboxes using the same /font/?
Even tiny differences in the font settings could make the tab "seem"
to disappear.

HTH,
Phill W.
 
Phill said:
BTW, if you're doing lots of string concatenation like the above,
it's *far* more efficient to do it all in one statement, as in

TextBox19.Text = TextBox19.Text _
& objReq.Name & ControlChars.Tab _
& objReq.Number & ControlChars.Tab _
& objReq.Owner & ControlChars.NewLine

How about TextBox19.AppendText(...) ?

Andrew
 
I haven't seen the original question (Dunno where it is !), but I would
suggest using a StringBuilder in such cases, instead of using String
concatenation.

Regards,

Cerebrus.
 
Back
Top