Solved

Using columns in VB6 ListBox.

Posted on 2008-10-27
6
630 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…

726 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