How to resize a scroll composite to always fit its contents horizontally?
I have a scrolled composite ,it contains a tableViewer. My requirement is that if the table is increased in width,the scroll composite should not show horizontal scroll ,but it should expand to fit table's size. The only reason I have used a scrolled composite开发者_C百科 here is I want to show vertical scroll bar.
If you want to control the scrollbars of a Table
in SWT - which is a sub-class of Scrollable
- simply add one or more of the following styles in the constructor. If you construct a Viewer, the same styles are used.
SWT.H_SCROLL
Style constant for horizontal scrollbar behavior
SWT.V_SCROLL
Style constant for vertical scrollbar behavior
SWT.NO_SCROLL
Style constant for no scrollbar behavior
When neither H_SCROLL or V_SCROLL are specified, controls are free to create the default scroll bars for the control. Using NO_SCROLL overrides the default and forces the control to have no scroll bars.
精彩评论