Listbox multi collum

This is a discussion on Listbox multi collum within the Windows Programming forums, part of the Platform Specific Boards category; Hey ppl, I think this maybe asking a bit to much but i dont know to much about this area ...

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

    Listbox multi collum

    Hey ppl,

    I think this maybe asking a bit to much but i dont know to much about this area and i gotta learn

    I need to make a list box in this format:

    #file1#20k#c:\windows #
    #file2#5k#c:\ #
    #file3#6k#c:\ #
    #file4#25k#c:\program files#

    So basically a multi collumed list box, listing all files and there info.

    Can someone show me how to make one of these and also list all files and folders in the first collum. I think i can get the info on there size and location and then output it.

    Thanks for any help you can give.

    Cheers
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

  2. #2
    Registered User The15th's Avatar
    Join Date
    Aug 2001
    Posts
    125
    Hi TNT;

    im guessing your using the API here okay im also guessing your creating your list box as follows

    controlLST = CreateWindowEx(WS_EX_TOPMOST|WS_EX_STATICEDGE,"Lis tBox","",LBS_MULTIPLESEL | LBS_NOTIFY | WS_BORDER | WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL, 0, 0, 0, 0, hWnd,(HMENU)IDL_LBOX,g_hInst,0);

    now all you need to do is add the text you want to set into the list box using
    SendMessage (controlLST,LB_ADDSTRING, 0, (LPARAM) "text");

    and with each SendMessage call your string will be added to the next collum in the list control. so what i would do if i were you would be to use findfirstfile() get its size, sprintf() it into a buf with any other details you want about the file, then sendmessage() that buf to the list control, set up a while loop using FindNextFile() and do the same thing with that.

    i hope this helps.
    arrh, i got nothing good to say.
    http://www.praxis1.vic.edu.au/home/dcola/

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

    Thanks, i phraphs didnt make my original post clear, i meant vertical collums not horizontal ones, i think i need a special type of control for this, but i cannot remember it. Thanks for your help


    Cheers
    TNT
    TNT
    You Can Stop Me, But You Cant Stop Us All

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ListBox Extra Data Storage
    By Welder in forum Windows Programming
    Replies: 1
    Last Post: 11-01-2007, 02:46 PM
  2. cant load dialog with listbox, help
    By terracota in forum Windows Programming
    Replies: 2
    Last Post: 11-22-2004, 07: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, 09:52 PM
  4. Multi column Listbox
    By Gravedigga in forum Windows Programming
    Replies: 1
    Last Post: 10-12-2003, 01:20 PM
  5. Getting FULL filename from listbox
    By Garfield in forum Windows Programming
    Replies: 8
    Last Post: 01-27-2002, 08:28 AM

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