Search code examples
c#winformslistviewbackground-color

Change Background of Listview to Parent Background? C#


Is there A way I could change the background color of a listview to the color of the parent windows form? Thanks.


Solution

  • You could try subclassing ListView and use it with your control, with the following in the initialiser:

    SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);

    Otherwise, you could have a reference to your ListView object, and explicitly set the background colour in your form code.

    myListView.BackColor = this.BackColor