vbtab don't work...

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

    #1

    vbtab don't work...


    hello

    In fact the purpose of the code is to print some strings that i don't know
    the length before. But i want them to appears in two or three columns. So i
    thought that i could with the code (see the link in previous post) using
    vbtab. But vbtab has no effect to the string !!!!
    Hope this is clearer...
    thanks for your help
    pascal


    Ressource pédagogique SC@LPA.



  • rowe_newsgroups

    #2
    Re: vbtab don't work...

    On Apr 11, 8:59 am, "Pascal" <scalpano...@wa nadoo.rfwrote:
    hello
    >
    In fact the purpose of the code is to print some strings that i don't know
    the length before. But i want them to appears in two or three columns. So i
    thought that i could with the code (see the link in previous post) using
    vbtab. But vbtab has no effect to the string !!!!
    Hope this is clearer...
    thanks for your help
    pascal
    >
    http://www.scalpa.info
    You should be able to use ControlChars.Ta b instead.

    Thanks,

    Seth Rowe

    Comment

    • Andrew Morton

      #3
      Re: vbtab don't work...

      Pascal wrote:
      In fact the purpose of the code is to print some strings that i don't
      know the length before. But i want them to appears in two or three
      columns. So i thought that i could with the code (see the link in
      previous post) using vbtab. But vbtab has no effect to the string !!!!
      Hope this is clearer...
      thanks for your help
      Whatever entity you are using to display the strings does not "know" what
      you mean by putting tabs in.

      The simplest way would to get columns be to use a fixed-width font like
      Courier and pad strings to the desired position with PadLeft and/or PadRight
      as appropriate.

      Andrew


      Comment

      • Shane

        #4
        Re: vbtab don't work...

        As Andrew said, many (most) of the standard controls don't know how to
        display a tab. I believe that the textbox shows a small rectangle for
        the character.

        The RichTextBox does support the tab, but it is also a bit dangerous:
        If you have a line with short text and a tab, and another line with
        fairly long text and a tab, your columns may not line up correctly.
        You could handle the issue by forcing a fixed width font, again as
        Andrew suggested; use the ".Padright" method on your strings to force
        additional spaces as needed.

        I don't know what your aplication is doing, but perhaps a listview in
        detail mode may be a better choice. You can set up column sizes
        independent of the text size.

        Shane

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: vbtab don't work...

          "rowe_newsgroup s" <rowe_email@yah oo.comschrieb:
          >In fact the purpose of the code is to print some strings that i don't
          >know
          >the length before. But i want them to appears in two or three columns. So
          >i
          >thought that i could with the code (see the link in previous post) using
          >vbtab. But vbtab has no effect to the string !!!!
          >Hope this is clearer...
          >thanks for your help
          >pascal
          >>
          >http://www.scalpa.info
          >
          You should be able to use ControlChars.Ta b instead.
          A tab is a tab is a tab, irregardless of whether you use 'vbTab',
          'ControlChars.T ab', or 'ChrW(9)'.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          Working...