foreach ()


The foreach () is used to handle a group of similar category objects.
  • Syntax:
    foreach (<Object> <Obect_name> in <collection>)

    {

    Statement(s);

    }
  • E.g.:
    foreach (control c in this.control)
    {
    MessageBox.Show(c.GetType().Name)
    }

0 comments :

Post a Comment

> Related Posts with Thumbnails
 

Copyright © 2012. GS dot net - All Rights Reserved - Design by BTDesigner - Proudly powered by Blogger