Guest User

Untitled

a guest
Jan 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //labels: lbl_01_temp, lbl_02_temp, lbl_03_temp
  2. string XX;
  3. double id_01_temp, id_02_temp, id_03_temp;
  4. lbl_XX_temp.Text= "The Device " +XX+ "has" +id_XX_temp+" ℃";
  5.  
  6. lbl_XX_temp.Text= String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
  7.  
  8. string lblSelected = String.Format("lbl_{0}_temp", XX);
  9. Label lbl = (Label)this.FindControl(lblSelected);
  10. lbl.Text = String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
  11.  
  12. string lblSelected = String.Format("lbl_{0}_temp", XX);
  13. Control[] ctrl = this.Controls.Find(lblSelected, true);
  14. Label lbl = ctrl[0] as Label;
  15. lbl.Text = String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
  16.  
  17. labels[index].Text = "Device " + (index + 1) + " has temperature "
  18. + temperatures[index].ToString(formatString) + " ℃";
  19.  
  20. for (int i=1; i<=6; i++)
  21. {
  22. Label label = GetLabelForIndex(i);
  23. //do something with the label here
  24. }
Add Comment
Please, Sign In to add comment