【问题标题】:MS - Access automatic scroll on list box.MS - 访问列表框上的自动滚动。
【发布时间】:2018-12-05 23:08:41
【问题描述】:

我创建了一个访问数据库表单,该表单在列表框中显示用户列表及其工作效率。但是,当我获得超过 20 个用户时,列表框无法在不滚动的情况下显示其余用户。

有没有一种方法可以让列表框自动滚动到底部,然后像在无限循环中播放的电影中的片尾字幕一样重置到顶部?

【问题讨论】:

    标签: ms-access listbox vba ms-access-2016 autoscroll


    【解决方案1】:

    按照您的要求,我认为您需要构建自己的滚动条! 我会用这些东西来实现:

    • 设置为多行的文本框
    • 一个数组,每行文本显示在单独的单元格中(如果你够勇敢的话,也可以是一个记录集)
    • 用于更新文本框的计时器函数
    • 一个全局计数器,用于跟踪正在显示的文本的当前第一行编号

    伪代码:

    Init:
        clear the text box
        load the array with the text & append each line to the text box as you go.
        set the pointer to 1
    
    UpdateText (timer event):  
    ' get length of current string
        iLength = array(counter).text.length
        ' chop the first row off the text
        textbox.text  = right(textbox.text, len(textbox.text) - iLength)
        ' add the text back on to the end
        textbox.text.appendtext( array(counter).text)
        increment counter
        if counter > array-num-items, set counter to 1   ' scroll over
    

    玩得开心!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多