Convert.ToInt32(pArray.Length.MinValue).ToString
Array.TrueForAll
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionSub SetParamArray(ByVal pName As String, ByVal ParamArray pArray() As String) Dim I As Integer Debug.WriteLine(pArray.Length.ToString & " Paramètres pour " & pName) For I = 0 To (pArray.Length - 1) Debug.WriteLine("pArray(" & I & ") = " & pArray(I)) Next I End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Test2() As String = {"A", "B"} Dim Test3 As Array = Array.CreateInstance(GetType(String), Test2.Length) Test3.SetValue("A", 0) Test3.SetValue("B", 1) SetParamArray("Test 1", "A") SetParamArray("Test 2", Test2) SetParamArray("Test 2", Test3.ToString) End Sub
TypeOf New String() {} Is Array
SetParamArray("Test 3", DirectCast(Test3, String()))
Function CheckType(ByVal myObject As Object, ByVal myType As Type) As Boolean If TypeOf myObject Is curAny Then Return True Else MsgBox("L'objet n'est pas un type <" & curType.ToString & ">" & vbCrLf & "C'est un object de type: " & myObject.GetType.ToString, vbExclamation) End If End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox(CheckType(Me.PictureBox1, array) MsgBox(CheckType(Me.PictureBox1, PictureBox)) End Sub