Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb: for each (ctl in form1) --> c# equivalent?

Status
Not open for further replies.

Pumzy

Programmer
Nov 20, 2003
13
JP
Hello people! I would like to ask for some clue on how to use the foreach reserved word in c# when enumerating controls in a form...

thanks...

KDjLogan
 
The following handler will list the controls in the current form:
private void button1_Click(object sender, System.EventArgs e)
{
foreach (Control ctl in this.Controls)
{
MessageBox.Show(ctl.ToString());
}
}


-obislavu-
 
hey obislavu many thanks for your help!
very kind of yours for newbie like me...

pumzy :)

KDjLogan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top