zoukankan      html  css  js  c++  java
  • panel 绑定鼠标滚轮事件

     1 void formsample_mousewheel(object sender, MouseEventArgs e)
     2         {
     3             //获取光标位置
     4             Point mousepoint = new Point(e.X, e.Y);
     5             //换算成相对本窗体的位置
     6             mousepoint.Offset(this.Location.X, this.Location.Y);
     7             //判断是否在panel内
     8             if (pl_message.RectangleToScreen(pl_message.DisplayRectangle).Contains(mousepoint))
     9             {
    10                 //滚动
    11                 pl_message.AutoScrollPosition = new Point(0, pl_message.VerticalScroll.Value - e.Delta);
    12             }
    13         }
    1  this.MouseWheel += formsample_mousewheel;
  • 相关阅读:
    软考
    码云
    vue和bpmnjs
    工作流引擎
    net core restapi
    工厂模式
    sqlmanage
    类的扩展
    导出excel
    拼图
  • 原文地址:https://www.cnblogs.com/wuhailong/p/6277018.html
Copyright © 2011-2022 走看看