本文介绍了SWT树>将垂直滚动条移动到树的左侧而不改变方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将垂直滚动条放在树的左侧?
How to put the vertical scroll bar on the left hand side of the tree?
推荐答案
如果你只使用 Windows,你可以这样做:
If you are on Windows only, you could do this:
int exStyle = OS.GetWindowLong(tree.handle, OS.GWL_EXSTYLE);
exStyle |= OS.WS_EX_LEFTSCROLLBAR;
OS.SetWindowLong(tree.handle, OS.GWL_EXSTYLE, exStyle);
否则你可能想看看 Snippet296,展示了如何使用 ScrolledComposite 处理树的滚动.通过将样式 SWT.RIGHT_TO_LEFT 添加到 ScrolledComposite,并将 SWT.LEFT_TO_RIGHT 添加到此代码段中的树,我在左侧有一个滚动条.但是我没能解决Tree的定位问题,然后就出现了.
Otherwise you might want to look into Snippet296, which shows how to handle scrolling for a Tree using a ScrolledComposite. By adding the style SWT.RIGHT_TO_LEFT to ScrolledComposite, and SWT.LEFT_TO_RIGHT to the Tree in this snippet, I had a scroll bar on the left. But I failed to fix the positioning issue of the Tree, which comes up then.
这篇关于SWT树>将垂直滚动条移动到树的左侧而不改变方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!