vbtab don't work...

  • Thread starter Thread starter Pascal
  • Start date Start date
P

Pascal

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
 
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.Tab instead.

Thanks,

Seth Rowe
 
Pascal said:
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
 
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
 
rowe_newsgroups said:
You should be able to use ControlChars.Tab instead.

A tab is a tab is a tab, irregardless of whether you use 'vbTab',
'ControlChars.Tab', or 'ChrW(9)'.
 
Back
Top