Solved

Using columns in VB6 ListBox.

Posted on 2008-10-27
6
603 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

943 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

10 Experts available now in Live!

Get 1:1 Help Now