DeepButi
January 4th, 2005, 05:35 AM
Recently I discovered that assigning a value to a list box item resets TopIndex to zero.
ListBox1.Items.Item(n) = "Something" '... implies .... ListBox1.TopIndex = 0
This seems a little bit incongruent with other situations, for instance,
ListBox1.Items.Add("Something")
doesn't modify TopIndex.
Obviously I can get/reset the value
PrevIndex = ListBox1.TopIndex
ListBox1.Items.Item(n) = "Something"
ListBox1.TopIndex = PrevIndex
but, is there any way to avoid it?
Thanks
ListBox1.Items.Item(n) = "Something" '... implies .... ListBox1.TopIndex = 0
This seems a little bit incongruent with other situations, for instance,
ListBox1.Items.Add("Something")
doesn't modify TopIndex.
Obviously I can get/reset the value
PrevIndex = ListBox1.TopIndex
ListBox1.Items.Item(n) = "Something"
ListBox1.TopIndex = PrevIndex
but, is there any way to avoid it?
Thanks