April 25, 2024, 07:46:21 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


how to code columns in a listbox

Started by arono, January 11, 2017, 02:43:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arono

Hi,

I have created a listbox Control and it works fine.  Now I would like to change it to contain two columns.  Looking at the docs there isn't much on this.  I understand that the @CTLISTCOLUMNS attribute needs to be added to the Control statement, the SETLBCOLWIDTH is used to set the width and ADDSTRING is used to add entries to the listbox.

My questions are:
   - How do I indicate that I want 2 columns?
   - How do I indicate the width for each of the columns?
   - How do I use ADDSTRING to add two columns of data for the entries in the listbox?

Thanks for your help, again.

billhsln

I think you should look at LISTVIEW, not LISTBOX.  LISTVIEW allows more than 1 column of data.

Bill
When all else fails, get a bigger hammer.

Brian

Here's a multi-column listbox for you to look at (attached)

Brian

arono

Thanks Bob and Bill,

I'll look into your suggestions.

Brian


LarryMc

Quote from: Brian Pugh on January 12, 2017, 09:28:54 AM
Bob ?!?!
Hey, I get Tim all the time because my email starts tlmcc.
Besides, Brian looks a lot like Bob anyways .....lol!

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

To Brian Pugh (Bob?),

Very cool, I did not know that ListBox could do that.  Is the 'SETLBCOLWIDTH d1,1,85' line what allows the columns?

Thanks,
Bill
When all else fails, get a bigger hammer.

Brian

Billy Bob,

From the IWB Help file:
Sets the width in pixels of columns in a multi-column list box. A multi-column list box has fixed column widths

If you create a list box in the dialog editor, you can set a flag to create a multi column list box

Brian Bob