将列表框滚动到顶部选择
有没有办法以编程方式向下滚动多选 ListBox
以显示顶部选择?这里使用 ASP.NET。
更新(澄清): 有一个带有多选 ListBox
的表单,其中包含很多项目(国家/地区列表),因此并非所有项目同时可见。用户做出一项或多项选择并保存表单。稍后,用户返回编辑它,我想自动滚动 ListBox
以显示用户所做的第一个选择。例如,如果用户选择葡萄牙,我希望 ListBox 滚动,以便用户立即在屏幕上看到它,而不需要手动向下滚动到它。
Is there any way to programmatically scroll down a multiselect ListBox
to show the top selection? Using ASP.NET here.
UPDATE (to clarify):
There's a form with a multiselect ListBox
with a lot of items (country list), so not all of them are visible at the same time. The user makes one or several selections and saves the form. Later, the user goes back to edit it, and I want to automatically scroll the ListBox
as to show the first selection the user made. For example, if the user selected Portugal, I want the ListBox
to scroll so that the user sees it on the screen straight away, and doesn't need to manually scroll down to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论