mattst
October 3rd, 2009, 06:48 AM
I have a minor but annoying problem with the display of an empty ListBox.
During the course of an application a ListBox displays various to-do items which get consecutively removed programatically as the items are completed until, on completion, the ListBox is empty. The 'current item' is always the first/top item in the ListBox and that item is selected to get it highlighted so the user knows which is the currently active task.
On completion the ListBox is empty, however where the top item would be, if there was one, a dotted rectangle is displayed. See this screen capture:
http://www.zilefile.com/files/8746_vqpzd/Cap_01.jpg
How can I stop this dotted rectangle ('phantom selection') being shown?
I've tried several things like setting the SelectionMode to None, using ClearSelected(), both, and using Refresh(), disabling then re-enabling the control (Enabled = false/true with refreshing between them) - none of these remove the dotted selection.
I know this is a minor thing but it's now really annoying me - not so much the actual dotted selection, but my inability to get rid of it. Please help before things get out of hand and it causes me a nervous breakdown. :D
Thanks gurus.
During the course of an application a ListBox displays various to-do items which get consecutively removed programatically as the items are completed until, on completion, the ListBox is empty. The 'current item' is always the first/top item in the ListBox and that item is selected to get it highlighted so the user knows which is the currently active task.
On completion the ListBox is empty, however where the top item would be, if there was one, a dotted rectangle is displayed. See this screen capture:
http://www.zilefile.com/files/8746_vqpzd/Cap_01.jpg
How can I stop this dotted rectangle ('phantom selection') being shown?
I've tried several things like setting the SelectionMode to None, using ClearSelected(), both, and using Refresh(), disabling then re-enabling the control (Enabled = false/true with refreshing between them) - none of these remove the dotted selection.
I know this is a minor thing but it's now really annoying me - not so much the actual dotted selection, but my inability to get rid of it. Please help before things get out of hand and it causes me a nervous breakdown. :D
Thanks gurus.