CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Sep 2009
    Posts
    62

    Minor but annoying problem with empty ListBox display.

    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.

    Thanks gurus.
    Last edited by mattst; October 3rd, 2009 at 07:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured