?
Solved

Using columns in VB6 ListBox.

Posted on 2008-10-27
6
Medium Priority
?
644 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 143

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 143

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…
Suggested Courses

770 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