Draw a line on horizontal scrollbar - C#

2019-08-27 21:49发布

问题:

Is there any way to draw a line (about 5 pixels width) on hScrollBar ? The line will move from one end to another. It will represent the movement.

Thank you,

回答1:

I think its possible. You have two options - an owner drawn scrollbar (an example in C++/MFC to get a hang - http://www.codeproject.com/Articles/14724/Replace-a-Window-s-Internal-Scrollbar-with-a-custo ), the second option is to track the scrollbar movements, draw the line and repaint it.

EDIT

This might be of help too - http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstyleelement.scrollbar.lefttrackhorizontal.aspx