J'ai trouvé ça mais j'y connaît rien en .NET, ça m'a l'air bien bourrin, en gros laisses tomber, c'est lié au thème de windows de toute façon non ?
There is no managed way to change the the background color of the scrollbar.
however we may handle the win32 message WM_CTLCOLORSCROLLBAR to change the
background color. Here is a list of steps to do this:
1. define a derived class from DataGrid
2. override WndProc and handle the WM_CTLCOLORSCROLLBAR messge.
like below:
Code :
- protected override void WndProc(ref Message m)
- {
- const int WM_CTLCOLORSCROLLBAR = 0x0137;
- const int BLACK_BRUSH = 4;
- if (m.Msg == WM_CTLCOLORSCROLLBAR && m.LParam == this.VertScrollBar.Handle)
- {
- m.Result = GetStockObject(BLACK_BRUSH);
- return;
- }
- base.WndProc (ref m);
- }
|
according to the doc of this message, you need return a HBRUSH handle , you
may create your brush object by pinvoke GDI APIs, however you need delete
them when they are no longer needed.