private void InitControls() { var result = ServiceNum.GetColorArray(); var red = Color.Red; var blue = Color.Blue; var green = Color.LimeGreen; result.Remove(49); #region 特大 var list = result.Where(x => x.Key > 24); var xInn = 23; int index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 26); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特小 list = result.Where(x => x.Key < 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 48); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特单 list = result.Where(x => x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 70); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特双 list = result.Where(x => x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 92); //lb.Location = new Point(448 + xInn * index, 26); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特大单 list = result.Where(x => x.Key > 24 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 114); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特小单 list = result.Where(x => x.Key <= 24 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 136); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特大双 list = result.Where(x => x.Key > 24 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 158); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 特小双 list = result.Where(x => x.Key <= 24 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 180); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 合大 list = result; var num = 0; var sum = 0; index = 0; var hxIndex = 0; var hdIndex = 0; var hsIndex = 0; var hddIndex = 0; var hxdIndex = 0; var hdsIndex = 0; var hxsIndex = 0; for (int i = 1; i <= 48; i++) { num = i; while (num > 0) { sum += num % 10; //每次的余数都是末尾的数字 num /= 10; //因为是INT型的所以等于直接去掉最后的数字. } if (sum > 6) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 26); this.groupBox3.Controls.Add(lb); index = index + 1; } if (sum <= 6) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hxIndex, 48); this.groupBox3.Controls.Add(lb); hxIndex = hxIndex + 1; } if (sum % 2 != 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hdIndex, 70); this.groupBox3.Controls.Add(lb); hdIndex = hdIndex + 1; } if (sum % 2 == 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hsIndex, 92); this.groupBox3.Controls.Add(lb); hsIndex = hsIndex + 1; } if (sum > 6 && sum % 2 != 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hddIndex, 114); this.groupBox3.Controls.Add(lb); hddIndex = hddIndex + 1; } else if (sum > 6 && sum % 2 == 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hdsIndex, 136); this.groupBox3.Controls.Add(lb); hdsIndex = hdsIndex + 1; } else if (sum <= 6 && sum % 2 != 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hxdIndex, 158); this.groupBox3.Controls.Add(lb); hxdIndex = hxdIndex + 1; } else if (sum <= 6 && sum % 2 == 0) { Label lb = new Label(); lb.Text = i.ToString().PadLeft(2, '0'); lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * hxsIndex, 180); this.groupBox3.Controls.Add(lb); hxsIndex = hxsIndex + 1; } sum = 0; num = 0; } index = 0; #endregion }
private void InitControls() { var result = ServiceNum.GetColorArray(); var red = Color.Red; var blue = Color.Blue; var green = Color.LimeGreen; #region 红波 var list = result.Where(x => x.Value == red); var xInn = 23; int index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 26); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 蓝波 list = result.Where(x => x.Value == blue); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 48); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 绿波 list = result.Where(x => x.Value == green); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 70); this.groupBox2.Controls.Add(lb); index = index + 1; } #endregion #region 半波--红大 list = result.Where(x => x.Value == red && x.Key > 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 26); //lb.Location = new Point(448 + xInn * index, 26); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--红小 list = result.Where(x => x.Value == red && x.Key <= 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 26); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--红单 list = result.Where(x => x.Value == red && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 48); //lb.Location = new Point(448 + xInn * index, 26); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--红双 list = result.Where(x => x.Value == red && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 48); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--蓝大 list = result.Where(x => x.Value == blue && x.Key > 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 70); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--蓝小 list = result.Where(x => x.Value == blue && x.Key <= 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 70); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--蓝单 list = result.Where(x => x.Value == blue && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 92); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--蓝双 list = result.Where(x => x.Value == blue && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 92); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--绿大 list = result.Where(x => x.Value == green && x.Key > 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 114); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--绿小 list = result.Where(x => x.Value == green && x.Key <= 25); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 114); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--绿单 list = result.Where(x => x.Value == green && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 136); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半波--绿双 list = result.Where(x => x.Value == green && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 136); this.groupBox3.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--红大单 list = result.Where(x => x.Value == red && x.Key > 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 26); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--红大双 list = result.Where(x => x.Value == red && x.Key > 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 26); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--红小单 list = result.Where(x => x.Value == red && x.Key <= 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 48); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--红小双 list = result.Where(x => x.Value == red && x.Key <= 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 48); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--蓝大单 list = result.Where(x => x.Value == blue && x.Key > 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 70); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--蓝大双 list = result.Where(x => x.Value == blue && x.Key > 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 70); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--蓝小单 list = result.Where(x => x.Value == blue && x.Key <= 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 92); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--蓝小双 list = result.Where(x => x.Value == blue && x.Key <= 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 92); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--绿大单 list = result.Where(x => x.Value == green && x.Key > 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 114); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--绿大双 list = result.Where(x => x.Value == green && x.Key > 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 114); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--绿小单 list = result.Where(x => x.Value == green && x.Key <= 25 && x.Key % 2 != 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(151 + xInn * index, 136); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion #region 半半波--绿小双 list = result.Where(x => x.Value == green && x.Key <= 25 && x.Key % 2 == 0); index = 0; foreach (var item in list) { Label lb = new Label(); lb.Text = item.Key.ToString().PadLeft(2, '0'); lb.BackColor = item.Value; lb.Width = 19; lb.Height = 12; lb.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); lb.Location = new Point(496 + xInn * index, 136); this.groupBox4.Controls.Add(lb); index = index + 1; } #endregion }