Is way to Override the Disabled appearance of ListView Control

Hi all,

is it possible for me to override the appearance of the ListView Control when its enabled property is set to False (disabled)

I guess I need to change the colour as when the ListView Control is disabled, its very hard to actually see what value is selected if there are only two entries in the ListView.

Thanks



Answer this question

Is way to Override the Disabled appearance of ListView Control

  • Mohamed Anas

    No it's not.
  • morpheus3230

    You cannot even select the entries in a listview if its status is disabled. so the question is not existing

    Thanks

    Ratheesh



  • Dwz2006

    Try this

    Listview.Enabled = false; // Disables listview

    // suppose you want to select the 3rd item in the list view.. . now write

    Listview.Items[2].Selected = true; // This will highlight the 3 rd item as selected ( with blue color) in the listview

    Regards

    Ratheesh



  • nick865

    Oh sorry. I for some reason thought .Net CF did support this.

    AlexY describes how to make an owner drawn listbox here: http://www.opennetcf.org/PermaLink.aspx guid=d88b1a1a-a866-4247-a0c8-94ab3c124f63.



  • Nonu_k

    If ListView.BackColor doesn't work, you can make it owner drawn.

  • Aaron Sulwer

    Then why I am being given this information :(


  • Shahab03

    I do not even want to select an item from the disabled ListView.

    What I am asking to see if I can override the backcolour of the ListView when it is in the Disabled state because at the moment in my application when the control is disable and there are two items in the ListView (one of which is selected) and its disabled (I select an item in the ListView then disable it) it is very hard to actually see what the selected item in the ListView is.

    Tryst


  • OUPRO

    Thanks for the link.

    Is this supported by the Compact Framework, as I can't see any reference to it in the article you provided.

    Thanks

    Tryst


  • tokie

    OK, thanks Lee. I will check it out.


  • vaughanSkyblue

    There's some good information on MSDN about ListView.OwnerDraw at http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.ownerdraw.aspx.

  • MannyG09

    Hi Scarlett Lee,

    what do you mean, by 'Make it owner drawn'

    Thanks


  • Is way to Override the Disabled appearance of ListView Control