提交当前本机整理版本
This commit is contained in:
@@ -10449,4 +10449,31 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void GridView_MouseWhee
|
||||
private void GridView_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
HandledMouseEventArgs handledArgs = e as HandledMouseEventArgs;
|
||||
if (handledArgs != null)
|
||||
{
|
||||
handledArgs.Handled = false; // 放行事件,允许系统处理Shift+滚轮
|
||||
}
|
||||
if ((ModifierKeys & Keys.Shift) == Keys.Shift)
|
||||
{
|
||||
// 滚轮方向判断
|
||||
int scrollStep = e.Delta > 0 ? -20 : 20; // 滚动步长,可调整(建议10-30)
|
||||
// 计算滚动条位置
|
||||
int newLeftCoord = gridView.LeftCoord + scrollStep;
|
||||
newLeftCoord = Math.Max(0, newLeftCoord);//Math.Min(newLeftCoord, maxLeftCoord)
|
||||
// 移动滚动条位置
|
||||
gridView.LeftCoord = newLeftCoord;
|
||||
|
||||
if (handledArgs != null)
|
||||
{
|
||||
handledArgs.Handled = true;// 阻止默认垂直滚动
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user