我創建了一個函數來檢查我的表單中是否存在控件類型,但它沒有奏效,我不知道問題出在哪裏。類型'_Control'未定義
這是我寫的代碼:
Private Function testIfControlExists(ByVal _Control As Control)
For Each c As Control In Me.Controls
If TypeOf c Is _Control Then
Return True
End If
Next
Return False
End Function
這是錯誤消息我得到:1種類型 '_Control' 沒有定義
錯誤。
但是,這是檢驗c是一個Control,我想測試c,如果它是我在我的函數中作爲參數給出的類型 –