Announcement

Collapse
No announcement yet.

ListView_DeleteItem...Doesn't

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • George Bleck
    replied
    DUH, I knew there was another reason why I grabbed the handle besides look for the current highlighted item.

    Thanks for the second set of eyes!



    ------------------
    George W. Bleck
    Senior System Engineer
    KeySpan Corporation

    Leave a comment:


  • Kev Peel
    replied

    Er, George,

    You are supposed to pass the listview Handle as a parameter...

    listview_deleteitem hDlg, lngIndex
    At a quick glance, this code is wrong!

    Or am I missing something?


    ------------------
    Kev G Peel
    KGP Software, Bridgwater, UK.
    www.go.to/kgpsoftware

    Leave a comment:


  • George Bleck
    started a topic ListView_DeleteItem...Doesn't

    ListView_DeleteItem...Doesn't

    Is there any trick to deleting an item from a ListView?

    I know I'm passing it a valid index number but the function always returns zero (failed).

    Here's the sub routine...

    Code:
    SUB EntryDelete( BYVAL hDlg AS DWORD )
    	LOCAL hlvPrinters AS LONG
    	LOCAL lngIndex AS LONG
    	CONTROL HANDLE hDlg, %lvPrinters TO hlvPrinters
    	lngIndex = ListView_GetNextItem( hlvPrinters, - 1, %LVNI_SELECTED )
    
    	IF lngIndex < > - 1 THEN
    
    		IF MessageBox( hDlg, "Are you sure you wish to delete the highlighted entry?", "Title Message", %MB_YESNO OR %MB_ICONQUESTION OR %MB_DEFBUTTON2 ) = %IDYES THEN
    			listview_deleteitem  hDlg, lngIndex
    		END IF
    
    	END IF
    
    END SUB


    ------------------
    George W. Bleck
    Senior System Engineer
    KeySpan Corporation
Working...
X