delphi - 在 RightToLeft bidimode 的右侧放置垂直滚动条的 Virtual TreeView 问题
问题描述
我使用以下代码将 VirtualTreeView 垂直滚动条放置在 RightToLeft bidimode 的右侧,并将其放置在 LeftToRight 模式的左侧。
procedure TForm1.Button2Click(Sender: TObject);
const
LSB = WS_EX_LEFTSCROLLBAR;
var
ExStyle: LONG_PTR;
begin
ExStyle := GetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE);
// Check if RTL alignment specified for you component
if AVTV.BiDiMode = bdRightToLeft then
begin
// If so, then exclude LSB-constant and allow Windows place
// scrollbar on the right side of window
if (ExStyle and LSB) = LSB then
SetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE, ExStyle and not LSB);
end
else
if AVTV.BiDiMode = bdLeftToRight then
begin
// The same as operation above but for LTR order
if (ExStyle and LSB) <> LSB then
SetWindowLongPtr(AVTV.Handle, GWL_EXSTYLE, ExStyle or LSB);
end;
end;
它可以正常工作,但是当树处于网格模式并具有标题列时会出现问题。请看截图:
解决方案
推荐阅读
- javascript - 索引对于键不是唯一的
- python - Python 3.6.5 如何显示带有名称的文件中的 top5 分数?
- javascript - GET 请求图像后 AWS S3 上传,未正确上传
- java - 我的关于带有阶乘的 for 循环的 Java 代码无法正常工作
- c - 如何将 typedef struct 转换为 uint8_t 参数
- powershell - 做出选择时显示列表
- excel - 确定印刷成本的多重三条件语句
- reactjs - 使地图适合反应传单中的要素层边界
- testing - 基于 Azure Dev-Ops 查询的套件添加了 3 次项目
- sql - 可以选择离点表最近的点,但我还需要点名