setting TListBox.ItemIndex does not work after TListBox.Items.Clear
Original Reporter info from Mantis: Kon.pasc
-
Reporter name: Kon Golovatzkiy
Original Reporter info from Mantis: Kon.pasc
- Reporter name: Kon Golovatzkiy
Description:
Example is attached. Win32 LCL.
Summary:
if do not call ListBox1.ItemIndex to update FItemIndex between Items.Clear and setting ItemIndex to the same value as it was before, then ItemIndex will not be changed. Fix is easy, see line 548 in customlistbox.inc:
if AIndex=FItemIndex then
exit;
while in the code of Items.Clear FItemIndex value will not be reset.
Either remove "if AIndex=FItemIndex then exit;" or reset FItemIndex value anywhere Items are changed.
Mantis conversion info:
- Mantis ID: 17931
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.29 (SVN)
- Target version: 0.9.30