dim currPage as integer, lastPage as integer dim PageMax as integer dim i as integer dim currIndex, lastIndex as integer ......for i = 0 to 4 currIndex = currPage * 5 + i lastIndex = lastPage * 5 + i if currentPage > PageMax then load text1(currIndex) text1(currIndex).top = text1(lastIndex).top text1(currIndex).height = text1(lastIndex).height text1(currIndex).left = text1(lastIndex).left text1(currIndex).width = text1(lastIndex).width end if text1(lastIndex).visible = false text1(currIndex).visible = true next iif currPage > PageMax then PageMax = currPage
text(5).visual=true
然后调整位置
dim PageMax as integer
dim i as integer
dim currIndex, lastIndex as integer
......for i = 0 to 4
currIndex = currPage * 5 + i
lastIndex = lastPage * 5 + i
if currentPage > PageMax then
load text1(currIndex)
text1(currIndex).top = text1(lastIndex).top
text1(currIndex).height = text1(lastIndex).height
text1(currIndex).left = text1(lastIndex).left
text1(currIndex).width = text1(lastIndex).width
end if
text1(lastIndex).visible = false
text1(currIndex).visible = true
next iif currPage > PageMax then PageMax = currPage
只需建立一个变量数组。
当页滚动时,相应改写TextBox前面的Lable,并将相应变量元素的值赋给TextBox。
当TextBox的Change事件发生时,改写相应的变量元素。
这样开销更小。因为对于用户来说,视觉效果是一样的。