Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //labels: lbl_01_temp, lbl_02_temp, lbl_03_temp
- string XX;
- double id_01_temp, id_02_temp, id_03_temp;
- lbl_XX_temp.Text= "The Device " +XX+ "has" +id_XX_temp+" ℃";
- lbl_XX_temp.Text= String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
- string lblSelected = String.Format("lbl_{0}_temp", XX);
- Label lbl = (Label)this.FindControl(lblSelected);
- lbl.Text = String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
- string lblSelected = String.Format("lbl_{0}_temp", XX);
- Control[] ctrl = this.Controls.Find(lblSelected, true);
- Label lbl = ctrl[0] as Label;
- lbl.Text = String.Format("The Device {0} has {1} ℃", XX, id_XX_temp);
- labels[index].Text = "Device " + (index + 1) + " has temperature "
- + temperatures[index].ToString(formatString) + " ℃";
- for (int i=1; i<=6; i++)
- {
- Label label = GetLabelForIndex(i);
- //do something with the label here
- }
Add Comment
Please, Sign In to add comment