Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ API
test=CreateWindow("listbox", NULL, WS_VISIBLE|WS_CHILD|WS_BORDER|LBS_NOTIFY|LBS_MULTICOLUMN, 120,70,250,330, hwnd, (HMENU)IDM_BLB, NULL, NULL);
 
After creating above listbox, I want to put string in listbox using LB_ADDSTRING
But the problem is that I don't know how to distinguish two columns
 SendMessage(test, LB_ADDSTRING, 0, (LPARAM)"where");

If I do like above code, the string will be displayed in first column.
How can I display data in the column that I want to put in ?
 
[Edit]Code block added[/Edit]
Posted 28-Nov-12 5:39am
kyleK89361
Edited 28-Nov-12 5:41am
ProgramFOX122.7K
v2
Comments
CPallini at 28-Nov-12 13:46pm
   
A List Box with such style automatically arranges items on multiple columns, as Richard suggested, use a ListView instead.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You don't; a List Box[^] is a simple list of items. If you want a list with multiple columns then you must use a List View[^].
 
I just realised that I explained this to you yesterday in this question[^]. Please read the documentation that I have provided the links for rather than repeat the same question again.
  Permalink  
v2
Comments
CPallini at 28-Nov-12 13:44pm
   
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 853
1 OriginalGriff 410
2 CPallini 275
3 George Jonsson 226
4 Richard Deeming 145
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,482
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 28 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100