SWT tree > move the vertical scrollbar to the left of the tree without changing the orientation

梦想与她 提交于 2019-12-03 22:40:33

问题


How to put the vertical scroll bar on the left hand side of the tree?


回答1:


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);

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.



来源:https://stackoverflow.com/questions/3228323/swt-tree-move-the-vertical-scrollbar-to-the-left-of-the-tree-without-changing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!