Thread: ComboBox into ListView Item

  1. #1
    A.I Programmer
    Join Date
    Mar 2007
    Location
    Teresina - Brazil
    Posts
    47

    ComboBox into ListView Item

    Hello...

    Somebody knows as to insert a ComoboBox in a ListView Item, using C Language and Win32 API?

    bye

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    I'm not sure thats possible.

    But you could, try to make your own simple class of a listbox, and use comboboxes, as it's children.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Basics....

    You will need the WS_EDITLABELS style on the LV.

    Process mouse click events or similar messages to decide when the user wants to edit / needs a combo (I use LBUTTONDOWN).

    Check a valid item has been clicked (not an empty row).

    Get the rectangle that bounds the item to be edited (in client coords) ie where and how big to create the combo in the LV.

    Create the combo to have the LV as it's parent ie WS_CHILD and set the ID number as the HMENU param.

    Handle msgs in the combo, on loss of focus to the combo (ie closes) you need to find the selected item.

    You will need to notify the LV which string was selected. I do this by sending a WN_NOTIFY to the LV's parent dialog.

    This is a 'end lable edit' msg LVN_ENDLABELEDIT. I set the LPARAM of the WM_NOTIFY to a LV_DISPINFO struct. This containing the details of the edit (item, subitem, string ect)

    Process the WM_NOTIFY message and set the LV's item + subitem with the string using the details in the LV_DISPINFO struct.
    "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

  4. #4
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Actually, I'm glad I was wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  2. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  3. Replies: 6
    Last Post: 07-10-2006, 12:05 AM
  4. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 03:41 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM