Coloring the ListView scrollbars in C#.NET

sohaibi

Newcomer
Joined
Jul 21, 2003
Messages
3
Location
Karachi, Pakistan
Does anyone know how to color the scrollbars of the ListView in C#.NET? I had done it in VC by hooking the "WM_CTLCOLORSCROLLBAR" message in the window message function :D .

I have tried it in C#.NET like this:

private const int WM_CTLCOLORSCROLLBAR = 0x0137;

protected override void WndProc(ref Message m)
{
if(m.Msg == WM_CTLCOLORSCROLLBAR)
{
IntPtr l_nHdcScrollbar = m.WParam;
Graphics l_oGraphics = Graphics.FromHdc(l_nHdcScrollbar);
l_oGraphics.Clear(Color.Blue);
}
base.WndProc (ref m);
}

But its not working. I have also tried to debug it. While execution there are a lot of messages coming but not "WM_CTLCOLORSCROLLBAR" :( .

This is my first post to xtreme .NET Talk. Hope i'll get quick responses!
 
Back
Top