Modification de propriété d'un textbox
Bonjour,
J'ai créé une fonction permettant d'effacer tous les textbox dans une forme.
Je souhaiterai utiliser cette fonction pour, par exemple, limiter la taille du texte à 10 caractères. La propriété ctl.MaxLength est inaccessible (alors que ctl.Text l'est) !
Question : comment modifier cette propriété (ou une autre) ?
Merci
---------------------------------------------------------
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Private Sub EffacerTextBox(ByVal forme As Control)
Dim ctl As Control
For Each ctl In forme.Controls
If TypeOf ctl Is System.Windows.Forms.TextBox Then
ctl.Text = ""
Else
If TypeOf ctl Is System.Windows.Forms.GroupBox Then EffacerTextBox(ctl)
End If
Next ctl
Return
End Sub |