Looping through a hashtable or any keyed collection

LOOPING THROUGH HASHTABLE NET

C# Tutorials

  

LOOPING THROUGH HASHTABLE NET

Learn Tutorials
Looping through a hashtable or any keyed collection

Example code for Looping through hashtable NET:
foreach (string key in ButtonsCollection.Keys)
         {
            ControlItem ci=(ControlItem)ButtonsCollection[key];
            ci.EditLabel.Location=new System.Drawing.Point(10, yPos);
            ci.ShortEditBox.Location=new System.Drawing.Point(150, yPos);
            ci.LongEditBox.Location=new System.Drawing.Point(270, yPos);
            theFormToAddTo.Controls.Add(ci.ShortEditBox);
            theFormToAddTo.Controls.Add(ci.LongEditBox);
            theFormToAddTo.Controls.Add(ci.EditLabel);
            yPos+=22;
         }
This is example code for looping through a hashtable or any keyed collection