Solved

Using columns in VB6 ListBox.

Posted on 2008-10-27
6
613 Views
Last Modified: 2013-12-26
Hi,

Can somebody please give an example of how to use the VB6 ListBox columns?

Thanks,
Uni
0
Comment
Question by:Unimatrix_001
  • 3
  • 3
6 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22811805
assuming you really speak of listbox (and not of the listview):
http://en.allexperts.com/q/Visual-Basic-1048/2-columns-ListBox-Vb6.htm
0
 
LVL 3

Author Comment

by:Unimatrix_001
ID: 22811853
Hi Angellll,

Not following this too good:

ReDim LBTab(1) As Long 'for 3 tabs redim LBTab(1 to 3)as long
Why are we re-dimming this and what have tabs have to do with this?

LBTab(1) = 30
What is the purpose of this line?

SendMessageArray List1.hwnd, LB_SETTABSTOPS, 3, LBTab(1)
What is the purpose of this line?

Thanks,
Uni
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22811876
in a listbox, you don't have columns, actually.
however, a listbox has tab stops, and with the "tab" character in the data, you can simulate "columns" like that.

so, LBTab is the array that specifies at which positions the tab stops are (30 => is the offset).

the sendmessagearray sends the information (via api) to the listbox, so it defines those tab stops.
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 3

Author Comment

by:Unimatrix_001
ID: 22811912
Ok, so does the column property of the ListBox have any effect then if tab stops are used? Also, is there a defined behavior if a column overruns into the next offset?

Thanks,
Uni
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22811973
the Columns property is to make several columns of the data list
with columns=2: if you have 10 items, it will put some into column 1 and some into column2, but there is no concept of "rows of data". the 2 columns are like columns in a 2-columned word document (like a newspaper...)

>Also, is there a defined behavior if a column overruns into the next offset?
not 100% sure, but if I remember correctly, the text will start at the next tab stop right to the one where the previous column data ends.
so, you you have 1 column data overrunning the tab stop, all the remaining columns for that list item will be shifted right.
0
 
LVL 3

Author Closing Comment

by:Unimatrix_001
ID: 31510259
Ok, cheers angel... (-:
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question