Link to home
Start Free TrialLog in
Avatar of JimScott
JimScott

asked on

VB6 and vbTab

I am using a listbox to display a number of items separated by vbTab. The first vbTab seems to jump approx 20 spaces where subsequent ones jump approx 5 spaces.
How can I change the first vbTab to be 5 spaces also ?
Anyone any ideas ?
Avatar of ampapa
ampapa

Have you tried Tab(#)?
hello jimscott
 you use space your problem will be solved


List1.AddItem Space(5) & "sss" & Space(5) & "cc" & Space(5) & "cc" & Space(5) & "cc" & Space(5) & "cc"
The tab character goes from one tabstop to the next tabstop.   Tabstops are set up as 8 spaces, if the first word is 8 characters, then the tab will move the next item to offset 16.  

If the first word on row 2 is 3 characters then tab will move the next item to offset 8.  Tab doesn't put a fixed amount of space between each item, it moves to the next tabstop.  You could use your own formatting like mahesh suggests with spaces instead of tabs.  Another option is to use the ListView instead of the listbox.  It is designed for multiple columns and you can add items to each column as opposed to trying to format them.
ASKER CERTIFIED SOLUTION
Avatar of daffyduck14mil
daffyduck14mil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
From the looks of it, a typical hit and run action.
D.
Dan,

How can I object to your suggestion... ;-)

Grtz.©

D.