By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,693 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,693 IT Pros & Developers. It's quick & easy.

tab function in a multiline text box

P: n/a
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 !!
Feb 15 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"amruta" <am****@discussions.microsoft.com> wrote in message
news:CC**********************************@microsof t.com...
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.
Feb 16 '06 #2

P: n/a
Phill W. wrote:
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
Feb 16 '06 #3

P: n/a
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.

Feb 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.