tab function in a multiline text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amruta

    #1

    tab function in a multiline text box

    When Iam doing the following:

    TextBox19.Text &= objReq.Name & ControlChars.Ta b
    TextBox19.Text &= objReq.Number & ControlChars.Ta b
    TextBox19.Text &= objReq.Owner & ControlChars.Ne wLine


    TextBox20.Text &= objReq.Name & ControlChars.Ta b
    TextBox20.Text &= objReq.IDNumber & ControlChars.Ta b
    TextBox20.Text &= objReq.Owner & ControlChars.Ne wLine

    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 !!
  • Phill  W.

    #2
    Re: tab function in a multiline text box


    "amruta" <amruta@discuss ions.microsoft. com> wrote in message
    news:CC41EFFD-E67D-4EB1-9EE7-4F83C73CD363@mi crosoft.com...[color=blue]
    > When Iam doing the following:
    >
    > TextBox19.Text &= objReq.Name & ControlChars.Ta b
    > TextBox19.Text &= objReq.Number & ControlChars.Ta b
    > TextBox19.Text &= objReq.Owner & ControlChars.Ne wLine[/color]

    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.Ta b _
    & objReq.Number & ControlChars.Ta b _
    & objReq.Owner & ControlChars.Ne wLine
    [color=blue]
    > but in text box 20 first row does not get the first tab and then from 2nd
    > row it does fine.[/color]
    [color=blue]
    > tom4565 john
    > alice 9090 sim[/color]

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

    HTH,
    Phill W.


    Comment

    • Andrew Morton

      #3
      Re: tab function in a multiline text box

      Phill W. wrote:[color=blue]
      > 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.Ta b _
      > & objReq.Number & ControlChars.Ta b _
      > & objReq.Owner & ControlChars.Ne wLine[/color]

      How about TextBox19.Appen dText(...) ?

      Andrew


      Comment

      • Cerebrus99

        #4
        Re: tab function in a multiline text box

        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.

        Comment

        Working...