协调列表框滑块(VB6) [英] coordinated list box sliders (VB6)

查看:90
本文介绍了协调列表框滑块(VB6)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道当任何一个滑块移动时,如何移动多个相同数量的列表框滑块吗?我想确保列表框1中显示的信息在位置上与列表框2和列表框3中的相同条目相关.
我有3个列表框,框中的每个条目都包含与数据库中单个条目相关的信息.当将滑块移动到其中一个框中时,我需要将其他两个框中的条目移动相同的数量,以使这三个项目在所有三个列表框中的表观位置都相同,因为移动的框中的数据现在已占据.

因此,如果我在列表框1中移动滑块,以使条目17是显示的顶部项目,则列表框2和3也将被移动,以使条目17也是显示的顶部项目.如果在其他两个列表框中的任何一个上移动滑块,也是如此.使用以下代码,可以轻松实现.

 私有  Sub  LisBx1_scroll()

   Dim  X  as  整数

  X = LisBx1.TopIndex
  LisBx2.TopIndex = X
  LisBx3.TopIndex = X

结束  SUB  



对其他两个列表框执行相同的操作.


Anyone know how to move several list box sliders the same amount when any one of the sliders is moved? I want to be sure that info shown in list box 1 is positionally related to the same entries in list box 2 and list box 3.

I have 3 list boxes each entry in the boxes contains information related to a single entry in a database. When a slider is moved in one of the boxes, I need to move the entries in the other two boxes the same amount so that the three items occupy the same apparent position in all three list boxes as the data in the moved box now occupies.

So, if I move the slider in list box 1 so that entry 17 is the top item displayed, List boxes 2 and 3 will also be moved so that entry 17 is also the top item displayed. Same goes if I move slider on either of the other two list boxes.

解决方案

In the Listbox subroutines there is a subroutine for ''SCROLL''. Using the following code this can be accomplished easily.

Private Sub LisBx1_scroll()

  Dim X as integer

  X = LisBx1.TopIndex
  LisBx2.TopIndex = X
  LisBx3.TopIndex = X

End SUB



Do the same for the other two Listboxes.


这篇关于协调列表框滑块(VB6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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