For each Controle In tableLayoutPanel1

Résolu
XGuarden Messages postés 259 Date d'inscription dimanche 14 juillet 2002 Statut Membre Dernière intervention 17 août 2012 - 13 déc. 2006 à 16:05
 Utilisateur anonyme - 13 déc. 2006 à 17:12
Bonjour je cherche à faire ceci:

        For Each control As Control In tableLayoutPanel1.Controls
            if control est dans la colonne 2 then
                mon code....
            end if
        Next

donc je cherche simplemetn a faire un for each avec seulement les information de la deuxieme colonne.

Je cherche aussi a savoir sil exite un moyen de faire ceci:

        For Each control As textbox or combobox In tableLayoutPanel1.Controls
            code....
        Next

Finalement je cherhe égalemment a faire ceci lol

        For Each control As control In tableLayoutPanel1.Controls

            msgbox(control.type) 'doit donner le type.... label textbox combobox....

        Next

J'espere avoir été asser préci, merci d'avance =:0)

1 réponse

Utilisateur anonyme
13 déc. 2006 à 17:12
Salut,

1)



For Each control As Control In TableLayoutPanel1.Controls
  If TableLayoutPanel1.GetColumn(control) = 1 Then
    [TonCode]
  End If
Next,

----

(Coloration syntaxique automatique par Kenji)



2)



For Each control As Control In TableLayoutPanel1.Controls
  If control.GetType() Is GetType(System.Windows.Forms.TextBox) Or control.GetType() Is GetType(System.Windows.Forms.ComboBox) Then
    [TonCode]
  End If
Next,

----

(Coloration syntaxique automatique par Kenji)





__________
Kenji
3
Rejoignez-nous