24 ans
Messages postés231Date d'inscriptionlundi 27 novembre 2000StatutMembreDernière intervention 7 juillet 2008
-
18 mai 2006 à 16:51
sebmafate
Messages postés4936Date d'inscriptionlundi 17 février 2003StatutMembreDernière intervention14 février 2014
-
18 mai 2006 à 17:05
Salut tout le monde
j'ai un petit question
jai une fonction en VB.NET qui permet de vider les TextBox d'un formulaire
et coici ca definition
Public
Sub ViderChamps(
ByRef frm
As Form)
Dim
MyObject
As
Object
For
Each
MyObject
In
frm.Controls
' Iterate through elements.
If
TypeOf
MyObject
Is
TextBox
Then
MyObject.text =
String
.Empty
'vider champs
End
If
Next
End
Sub
mais je voudrais faire le meme chose avec C# mais je n'arrive .
ya t'il un coud de main Merci D'avance
sebmafate
Messages postés4936Date d'inscriptionlundi 17 février 2003StatutMembreDernière intervention14 février 201437 18 mai 2006 à 17:05
public void ViderChamps(ref Form frm) {
foreach (Object myObject in frm.Controls) {
if (myObject is TextBox) {
(myObject as TextBox).Text = String.Empty;
}
}
}