C# Scrolling a Panel in windows forms

后端 未结 3 1996
礼貌的吻别
礼貌的吻别 2021-02-14 18:07

I\'m using VS2010, Windows 7

I have a panel with lots of picture-boxes. It has

AutoScroll = true

The scroll bars work properly when i d

3条回答
  •  猫巷女王i
    2021-02-14 19:06

    You scroll a Panel by assigning the AutoScrollPosition property. Beware that it uses negative values.

    The reason the mouse wheel doesn't work is because neither the panel nor the picture boxes are focusable controls. You'll need to rework the panel control a bit to make it a focusable. You'll find the code in this answer.

提交回复
热议问题