Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...