About multicolumn ListBox?

Discuss PocketC for CE (including Desktop Edition)

Postby BobShen on Sat Mar 03, 2001 2:37 pm

Hi everyone:
I create a multicolumn ListBox control.
How should I set each of column's width? When I want
to get third column's text.How to do that?
If I want to sort ListBox contents. Which column is
the sort of key?

Bob Shen
Bob Shen
Posts: 14
Joined: Sat Feb 24, 2001 4:21 am
Location: Taiwan

Postby guy on Sat Mar 03, 2001 4:40 pm

There are two types of multicolumn list box.

The first type, using LBS_MULTICOLUMN runs down the first column, then down the next, then the next. So when you sort it the order is that the value in the top of the second column is the one after the value at the bottom of the first column, and so on.

So all columns are the key.

The second type of multicolumn list box is the LBS_USETABSTOPS type. That is a single column list box, but with tabs in each row to separate out the sub-columns. You write a value into each row with tabs (\t) between the sub columns. The key for sorting in this type is the whole contents of the real column, including the tab characters.

I can't remember off the top of my head how you set column widths. I suspect that you send a message with a width in device units and all columns are set to that width. There is a simple rough mapping from characters to device units. I'll go and look it up and report back.

You can't set different widths for each column because that requires you to send a message with an array containing the various column widths. PocketC doesn't let you send messages containing an array.

PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 6 guests