<SWT树>将垂直滚动条移动到树的左侧而不更改方向 [英] SWT tree > move the vertical scrollbar to the left of the tree without changing the orientation
本文介绍了<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添加到此代码段中的树,我左侧有一个滚动条。但是我没能解决当时出现的树的定位问题。
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树>将垂直滚动条移动到树的左侧而不更改方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文