本帖最后由 bcrun 于 2011-02-11 11:17:38 编辑

解决方案 »

  1.   

    本帖最后由 bcrun 于 2011-02-11 11:17:35 编辑
      

  2.   

    Public Function Rangelimit(ByRef A() As Object, ByRef n As Integer)
      for i = 0 to ubound(A)
        If A(i).text > n Then
          MsgBox "输入数据不能大于" & n, 64, "输入提示"
          A(i).BackColor = vbRed
        Else
          A(i).BackColor = vbWhite
        End If
      next
    End Function
      

  3.   

    好像不可以哦,比如我在窗体上加TEXT1(0)、TEXT1(1)、TEXT1(2),我在text1_change(index as integer)事件下写:call Rangelimit(text1(),500) 运行会报错的?为什么?
      

  4.   

    调用时不时应该这样,你要调用整个Text控件数组,就把括号去掉
    call Rangelimit(text1,500)
      

  5.   

    本帖最后由 bcrun 于 2011-02-11 11:17:56 编辑
      

  6.   

    简单的这样不行吗
    for i= 0 to text1.ubound
       call Rangelimit(text1(i),500) 
    next