Click to See Complete Forum and Search --> : ListView messages


koler432
February 22nd, 2008, 02:29 PM
Which message is triggered as soon as the selected item is changed? By a click or using the keyboard or whatever means? I'm using LVN_ITEMCHANGING, but I'm wondered if there's a more proper one for this?
I'm trying to make it so when you change the item the text from the forms gets saved and is the replaced by the text from the other item. I noticed LVN_ITEMCHANGING is triggered quite a few times (3 IIRC) and if I'm not wrong, it's once because one item was deselected, one time to set the other item as selected and yet another time to focus the new item.
Thanks in advance.

heteroy
February 22nd, 2008, 06:11 PM
LVN_ITEMCHANGING occurs before the state has actually changed. This gives you a chance to refuse or alter the change.

LVN_ITEMCHANGED (http://msdn2.microsoft.com/en-us/library/bb774845.aspx) is the notification that occurs when the state is actually changed. Note you may still get several of these.