Solved

Using columns in VB6 ListBox.

Posted on 2008-10-27
6
597 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now