乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      解決VB中不能通過函數(shù)傳遞控件數(shù)組的問題(轉)

       chinablank 2011-12-15
      VB中的函數(shù)可以使用數(shù)組形參,但是卻不能傳遞控件數(shù)組,原因是VB中的控件數(shù)組和數(shù)組本身的構造方式不太一樣,雖然同是在內存中順序排列,但是調用方法卻有小小區(qū)別,控件數(shù)組的使用更象是一個集合。數(shù)組的使用
      僅僅只能通過Lboun和Ubound函數(shù)來獲取數(shù)組上下標,而控件數(shù)組則可使用control.Lbound,control.ubound屬性來獲取上下標。數(shù)組中訪問其元素只能使用Arr(Index)的方式,但控件數(shù)組則還可以通過control.item(index)來訪問。由于這點小小的不同,造成了控件數(shù)組不能當作函數(shù)參數(shù)傳遞的問題。
      現(xiàn)在我們通過2種方式來解決??!2種方式實現(xiàn)各不相同,所能應用的范圍也不一樣。
      第一種使用對象數(shù)組的方法:(例子說明)
      private sub SendControls()
          Dim Arr_Chk() as CheckBox
          Dim Int_I As Integer
          ReDim Arr_Chk(Chk_Tmp.Lbound To Chk_Tmp.Ubound)
          For Int_I =Chk_Tmp.Lbound to Chk_Tmp.Ubound
              Set Arr_Chk(Int_I)=Chk_Tmp.Item(Int_I)
          next
           Call TestControls(Arr_Chk)
      end sub
      private sub TestControls(ByRef TestControls() As CheckBox)
          Dim Int_I as Integer
          For Int_I=Lbound(TestControls) To Ubound(TestControls)
              debug.pring TestControls(Int_I).Name & "    " & TestControls(Int_I).Value
          next
      End Sub
      第二種方式,傳遞控件數(shù)組中一個元素。(這種方式有點取巧)
      Private Sub SendControls()
          call TestControls(Chk_Tmp.Item(Chk_Tmp.Lbound))
      end sub
      Private Sub TestControls(byval TestControl as CheckBox)
          Dim TmpControl as Object
           For Each TmpControl In Controls
               If TmpControl.Name=TestControl.Name Then
                   Debug.Print TmpControl.Name & "   " & TmpControl.Value
               end if
           Next
      End Sub

        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
        轉藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多