SVN r1005

SVN-Revision: r1005
This commit is contained in:
tdx
2025-09-28 08:24:08 +00:00
parent fa1738a965
commit 87313eadfb
+38 -1
View File
@@ -9772,4 +9772,41 @@ namespace Lskj.Control
return Rectangle.Empty;
// 转换为网格控件内的坐标(关键修正)
Point cellLocation = view.GridControl.PointToClient(
viewInfo.GridControl.PointToScreen(cellInfo.Bounds.Location)
);
return new Rectangle(
cellLocation.X,
cellLocation.Y,
cellInfo.Bounds.Width,
cellInfo.Bounds.Height
);
}
catch
{
return Rectangle.Empty;
}
}
// 计算按钮起始X坐标(支持左右对齐)
private int GetButtonStartX(int cellWidth, int totalButtonsWidth, bool isLeftAligned)
{
if (isLeftAligned)
{
// 靠左对齐:从单元格左侧开始
return 0;
}
else
{
// 靠右对齐:从右侧减去总宽度
return cellWidth - totalButtonsWidth;
}
}
#endregion
}
}