Howto atteindre les commandes dans un tabcontrol, je veux colorer toutes les textboxen en couleur avec une méthode simple foreach:Fetch contrôles dans un tabcontrol
foreach (Control c in this.Controls)
{
//btw I get the next error at this line: System.Windows.Forms.TabControl' is a 'type', which is not valid in the given context
if (c == System.Windows.Forms.TabControl)
{
c.BackColor = Color.FromArgb(240, 240, 240);
}
}
for (int i = 0; i < this.Controls.Count; i++)
{
if (this.Controls[i].GetType().ToString() == "System.Windows.Forms.Textbox")
{
this.Controls[i].BackColor = Color.FromArgb(240, 240, 240);
}
}
Quelqu'un pourrait-il aider mon changement d'un des deux codes
S'il vous plaît marquer vos questions correctement – skaffman