比如我在已经创建了控件组TEXT1,按一定位置排列,现在我放一个滚动条,当滚动一页时,TEXT1(0) 要被替换成TEXT1(5),TEXT1(1) 替换成TEXT1(6),依次类推,该怎么样实现呢??望高手们指点一二

解决方案 »

  1.   

    关键是我要在每个控件里付值,而且各不相同,在窗体上我也还没创建TEXT1(5)以上的控件,既我空间组里只有个5,然后我要动态创建该怎么做,可以说的详细点吗
      

  2.   

    你可以用load text(5)
    text(5).visual=true
    然后调整位置
      

  3.   

    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
      

  4.   

    如果是我,就不会使用动态控件组。
    只需建立一个变量数组。
    当页滚动时,相应改写TextBox前面的Lable,并将相应变量元素的值赋给TextBox。
    当TextBox的Change事件发生时,改写相应的变量元素。
    这样开销更小。因为对于用户来说,视觉效果是一样的。
      

  5.   

    同意,直接用一个Label或者textbox,动态显示里面的内容不能满足要求吗?