Hi, ich habe wiedermal ein kleines Problem
Ich habe eine Form in der mehrere Textboxen sind, wie kann ich herausfinden wieviele der Textboxen ausgefüllt worden sind, wenn man auf einen button klickt?
public int FilledTextBoxes()
{
int count = 0;
foreach(Control c in this.Controls)
{
TextBox tb = c as TextBox;
if(tb ! = null && tb.Text.Length > 0)
++count;
}
return count;
}
Geht natürlich nur, wenn die Textboxen als direktes Child-Control eingetragen sind (und nicht z.B. Teil eines Usercontrols sind)
MfG VizOne
--> Verschoben nach Windows Forms.
danke, geht