Beispiel #1
0
 public void ChangeLabelText(System.Windows.Forms.Form form)
 {
     if (form != null)
     {
         var labelIdWhoseTextNeedsToChange = "label2";     // Or any dynamic logic to determine which label will have to be updated.
         var labelControl = form.Controls.Find(labelIdWhoseTextNeedsToChange, false);
         if (labelControl != null)
         {
             form.ChangeLabel("Surname", labelControl);
         }
     }
 }