Howto change ListView backcolor?

  • Thread starter Thread starter Morten
  • Start date Start date
M

Morten

Hi,

Could someone please tell me, how to change the backcolor of a ListView in
the Compact Framework using C#.

ListView.BackColor = System.Drawing.Color.Black;
does not seem to work :(

Best regards,
Morten
 
If you can afford to wait until SP2 is released (should be
available by the end of this year), ListView.BackColor
will be working.

Regards,
Maarten Struys, eMVP
 
I'm about to finish my final project, and I'll have to hand it in the 6th of
January. :) So if I could find another solution, that would be preferred.

Regards,
Morten
 
What you might be able to do is using P/Invoke to send a LVM_SETBKCOLOR
message to listview control. You need to get the window handle for the
ListView control, which you can get for instance you can get with this
snippet:

using System.Runtime.InteropServices;

[DllImport("coredll")]
public static extern IntPtr GetCapture();

ListView.Capture = true;
IntPtr hWnd = GetCapture();
ListView.Capture = false;

Hope this helps you further.
 
Back
Top