How can I scroll my panel using my mousewheel?

前端 未结 9 1560
情歌与酒
情歌与酒 2021-01-17 09:19

I have a panel on my form with AutoScroll set to true so a scrollbar appears automatically.

How can I make it so a user can use his mouse wheel to scroll the panel?

9条回答
  •  星月不相逢
    2021-01-17 09:47

    I am using a windows form with BorderStyle set to none, where I use a panel to have all my controls in, so it looks nice (color difference and such..) was having the same issue while I had other forms that worked fine.

    What did I forgot:

       public myForm()
       {
            InitializeComponent();
            this.DoubleBuffered = true;
       }
    

    DoubleBuffered is magical I noticed..

提交回复
热议问题