List control label editing problem
-
When the user begins editing an item label in a list control, I'd like to select a portion of the text in the edit control. I'm using MFC and currently, I'm calling GetEditControl() in the LVN_BEGINLABELEDIT handler and then using SetSel() to set the selection in the edit control. This works as expected under Vista, but under XP, the code seems to have no effect and nothing is selected. Has anyone come across this behaviour before? Any help towards solving this problem is greatly appreciated.
-
When the user begins editing an item label in a list control, I'd like to select a portion of the text in the edit control. I'm using MFC and currently, I'm calling GetEditControl() in the LVN_BEGINLABELEDIT handler and then using SetSel() to set the selection in the edit control. This works as expected under Vista, but under XP, the code seems to have no effect and nothing is selected. Has anyone come across this behaviour before? Any help towards solving this problem is greatly appreciated.
-
Wonderful, it works! I guess that XP resets the selection after the LVN_BEGINLABELEDIT handler returns, so posting the message did the trick.
-
Wonderful, it works! I guess that XP resets the selection after the LVN_BEGINLABELEDIT handler returns, so posting the message did the trick.
Good old PostMessage, it helped me out a few times too. Maybe we should send flowers as a thank, or better, post flowers. :)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <