vba 在组合框/列表框中启用鼠标滚轮滚动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15992475/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 15:24:18  来源:igfitidea点击:

Enable mouse wheel scrolling in combobox/listbox

excelexcel-vbaexcel-2007mousewheeluserformvba

提问by ReidC

I am building a userform in Excel 2007 using VBA and would like to know how to enable mouse wheel scrolling of comboboxes and listboxes.

我正在使用 VBA 在 Excel 2007 中构建用户窗体,并想知道如何启用组合框和列表框的鼠标滚轮滚动。

Do I need a more recent version of Office to get this feature or is it something that can be coded for?

我是否需要更新版本的 Office 才能获得此功能,还是可以对其进行编码?

回答by Our Man in Bananas

if using 32-bit Windows then the solutions by PETER THORNTONusing WIN32 API calls on the below page will help:

如果使用 32 位 Windows,则PETER THORNTON使用以下页面上的 WIN32 API 调用的解决方案将有所帮助:

MSDN Forums - Visual Basic For Applications: Mouse scroll in UserForm ListBox in Excel 2010

MSDN 论坛 - Visual Basic For Applications:鼠标在 Excel 2010 中的用户窗体列表框中滚动

The OP on that page was using Excel 2010 but as it's API calls doing the work, so long as you are using 32-bit Windows then that should work for you too.

该页面上的 OP 使用的是 Excel 2010,但由于它是 API 调用,所以只要您使用的是 32 位 Windows,那么它也应该适用于您。

Philip

菲利普