Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CListBox question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a single-selection listbox in a dialog. When an item in that listbox is selected, various buttons in the dialog are enabled. One of those buttons gives the user the option to delete the selected item. My problem is that when I delete an item in the listbox I obviously now have no items selected but my buttons remained enabled.
I thought that the system would have generated a LBN_SELCHANGE message when the delete happens thereby allowing me to disable the buttons, but it doesn’t. I’ve tried posting a LBN_SELCHANGE message to the listbox but that doesn’t work.
How do I indicate to my program that there has been a change in my listbox?

Thanks.
 
have you try to call list.SetCurSel(-1);
just after the item deletion.
 
Thanks for replying.
SetCurSel(-1) doesn't work.
I've also tried capturing LBN_SELCANCEL, but again without success.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top