How to make an ownerdraw Trackbar in WinForms

后端 未结 3 1935
囚心锁ツ
囚心锁ツ 2021-01-03 02:56

I\'m trying to make a trackbar with a custom graphic for the slider thumb. I have started out with the following code:

namespace testapp
{
    partial class          


        
3条回答
  •  走了就别回头了
    2021-01-03 03:44

    I've solved it by setting the UserPaint style in the constructor like so:

    public MyTrackBar()
    {
        InitializeComponent();
        SetStyle(ControlStyles.UserPaint, true);
    }
    

    OnPaint now gets called.

提交回复
热议问题