如何在SWT的ComboBox中禁用水平滚动条 [英] How to Disable Horizontal Scroll bar in ComboBox in SWT

查看:161
本文介绍了如何在SWT的ComboBox中禁用水平滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个组合框,但遇到一个奇怪的行为,如果我的组合框中的元素数小于等于2,则无法看到水平滚动条。

I have created a combo Box but I am experiencing a strange behavior, If number of Elements in my Combobox is <= 2, I am unable to see a Horizontal scroll bar.

但是如果它们大于2,我会看到一个水平弹出的滚动条自动弹出。
我想要的是禁用水平滚动条。这是我正在使用的代码。

But if they are more than 2 then I see a horizontal scroll bar automatically pop up. What I would like is, to disable the horizontal scroll bar. This is the code I am using.

preferredResourceCombo = Components.createCombo(controlComposite, SWT.BORDER);
        GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
        gridData.widthHint = 150;
        preferredResourceCombo.setLayoutData(gridData);

        preferredResourceCombo.addVerifyListener(new ComboAutoSelectVerifyListener());

        // preferred resource combo modify listener at bottom of method
        preferredResourceComboViewer = new ComboViewer(preferredResourceCombo);
        preferredResourceComboViewer.setLabelProvider(SelectionItemLabelProvider.getInstance());
        preferredResourceComboViewer.setContentProvider(ArrayContentProvider.getInstance());

我到处都在使用相同的代码,但只有在这里,我才遇到这种情况。

I am using the same code everywhere but only here I am getting this behavior.What could be the possible causes?

推荐答案

关于此此处的错误报告。

不幸的是,到目前为止还没有解决方案。

Unfortunately, there is no solution so far.

这篇关于如何在SWT的ComboBox中禁用水平滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆