예제 #1
0
        private void LoadLabels()
        {
            int             I    = 0;
            List <Registro> list = RegistroDAO.GetTop5Temperaturas();

            for (int i = 0; i < list.Count; i++)
            {
                labels[i] = new Label();
                tableLayoutPanel7.Controls.Add(labels[i]);
                tableLayoutPanel7.SetRow(labels[i], i + 1);
                tableLayoutPanel7.SetColumn(labels[i], 0);
                labels[i].Text      = list[i].idUsuario;
                labels[i].TextAlign = ContentAlignment.MiddleCenter;
                labels[i].Font      = new Font("Microsoft Sans Serif", 12);
                labels[i].ForeColor = Color.Black;
                labels[i].Dock      = DockStyle.Fill;
                I++;
            }

            for (int i = 0; i < list.Count; i++)
            {
                labels[I] = new Label();
                tableLayoutPanel7.Controls.Add(labels[I]);
                tableLayoutPanel7.SetRow(labels[I], i + 1);
                tableLayoutPanel7.SetColumn(labels[I], 1);
                labels[I].Text      = list[i].temperatura.ToString();
                labels[I].TextAlign = ContentAlignment.MiddleCenter;
                labels[I].Font      = new Font("Microsoft Sans Serif", 12);
                labels[I].ForeColor = Color.Black;
                labels[I].Dock      = DockStyle.Fill;
                I++;
            }
        }