来源https://laorer.iteye.com/blog/654326
实现效果。winfrom界面显示时,滑动鼠标滚动,实现页面滚动
在窗体Load事件手动加载MouseWheel 事件
tableLayoutPanel1.MouseWheel += tableLayoutPanel1_MouseWheel;
private void tableLayoutPanel1_MouseWheel(object sender, MouseEventArgs e)
{
tableLayoutPanel1.Focus();
}
在tableLayoutPanel1控件中选择Scroll事件
private void tableLayoutPanel1_Scroll(object sender, ScrollEventArgs e)
{
tableLayoutPanel1.PerformLayout();
tableLayoutPanel1.Focus();
}
在窗体加载LOad中放入代码 实现进入页面滚动滑轮 实现页面滑动
tableLayoutPanel1.PerformLayout();
tableLayoutPanel1.Focus();