Listbox Craziness

This is a discussion on Listbox Craziness within the Windows Programming forums, part of the Platform Specific Boards category; How do you get those listboxes with multiple columns? I've tried searching but can't find any info. Hell, I even ...

  1. #1
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230

    Listbox Craziness

    How do you get those listboxes with multiple columns? I've tried searching but can't find any info. Hell, I even used Spy++ to spy on the styles Kazaa uses on its listbox, but I couldn't find any that looked like they made multiple columns...

    Any help?

  2. #2
    Registered User (TNT)'s Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    339
    Hey,

    prob no help but i tried this a while ago, and all i could find was that they are infact not called listboxes, now i have forgotten what there called sorry

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    SysListView32? That's what Kazaa uses in theirs...

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Lookup LBS_MULTICOLUMN on MSDN

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Try,
    Code:
    LISTVIEWhWnd=CreateWindow("SysListView32",NULL, WS_CHILD | WS_VISIBLE   | LVS_REPORT   | WS_BORDER 
    | WS_VSCROLL | WS_EX_RIGHTSCROLLBAR | WS_TABSTOP | LVS_OWNERDRAWFIXED
    ,Rect.left ,Rect.top ,iWidth ,iHeight ,hParent ,(HMENU)IDC_LISTVIEW ,hInst ,NULL ); 
    
    
    GetClientRect(LISTVIEWhWnd,&ClientRect);
    iWidth=(ClientRect.right-ClientRect.left)/NUM_COLUMNS;
    LVColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT ; 
    LVColumn.fmt = LVCFMT_LEFT;
    LVColumn.cx=iWidth;
    LVColumn.pszText = "Column Title"; 
    LVColumn.cchTextMax = lstrlen("Column Title"); 
    LVColumn.iSubItem = 0; 		
    LVColumn.iImage = 0; 		
    LVColumn.iOrder = 0; 		
    	ListView_InsertColumn(LISTVIEWhWnd,0,&LVColumn);
    with owner drawn listboxes
    Last edited by novacain; 02-17-2002 at 10:20 PM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Thanks, I'll try it out...

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    I think the important bit is the style

    LVS_REPORT
    (for multicolumn LV's)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Deal or No Deal listbox prob
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-30-2009, 06:53 PM
  2. cant load dialog with listbox, help
    By terracota in forum Windows Programming
    Replies: 2
    Last Post: 11-22-2004, 06:11 PM
  3. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 08:52 PM
  4. Listbox stealing focus
    By Calthun in forum Windows Programming
    Replies: 3
    Last Post: 09-12-2004, 04:36 PM
  5. Getting FULL filename from listbox
    By Garfield in forum Windows Programming
    Replies: 8
    Last Post: 01-27-2002, 07:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21