Bonjourà tous,
Dans ma classe j'ai :
et dans un module j'ai:Code:
1
2
3
4
5
6 Private Sub ChassisAddHandler() For Each InputControl As Control In ChassisInputControls AddHandler InputControl.TextChanged, AddressOf IsValueNumeric(ChassisInputControls, InputControl ?, InputControl.TextChanged ?) Next End Sub
Donc pour pouvoir me servir de la sub IsValueNumeric, j'ai ajouté l'argumentCode:
1
2
3
4
5
6
7
8
9 Public Sub IsValueNumeric(ByVal collection As System.Collections.Generic.List(Of System.Windows.Forms.Control), ByVal sender As Object, ByVal e As System.EventArgs) For Each InputControl As Control In ChassisInputControls If Not IsNumeric(InputControl.Text) Then InputControl.BackColor = Color.Red Else InputControl.BackColor = Color.White End If Next End Sub
mais je galère avec ceux du délégué...Code:(ByVal collection As System.Collections.Generic.List(Of System.Windows.Forms.Control)
Code:AddressOf IsValueNumeric(ChassisInputControls, InputControl ?, InputControl.TextChanged ?)