private void TempScreen_Load(object sender, EventArgs e) { int iPosx = 0; int iPosy = 0; Size szMain = new Size(iDigWidth, iDigHeight); labelUnit.Font = new System.Drawing.Font("7SEG", iUintFontSize, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); for (int i = 0; i < iDigCount; i++) { SevenSegmentSplick aItem = new SevenSegmentSplick(); aItem.Location = new Point(iPosx, iPosy); aItem.Value = "8"; aItem.Size = szMain; iPosx += iDigWidth; Controls.Add(aItem); lstDig.Add(aItem); if (iDecmailIndex == i + 1) { aItem.HadDot = true; } } labelUnit.Visible = bShowUint; if (bShowUint) { labelUnit.Location = new Point(iPosx, iPosy); iPosx += iUintFontSize + iDigWidth; } this.Size = new Size(iPosx, this.Height); }
private void RemakeOilDig() { Controls.Clear(); m_lstDig.Clear(); int iPosx = 0; int iPosy = 0; Size szMain = new Size(iMainDigWidth, iMainDigHeigh); Size szApp = new Size(iAppend99Width, iAppend99Height); for (int i = 0; i < iOilCardDigCount; i++) { SevenSegmentSplick aitem = new SevenSegmentSplick(); if (bEnableMdy) { aitem.BSplickAble = true; } else { aitem.BSplickAble = false; } aitem.Location = new Point(iPosx, iPosy); aitem.Size = szMain; aitem.Value = "8"; Controls.Add(aitem); iPosx += iMainDigWidth; if (iDecmialInMain == i + 1) { aitem.HadDot = true; } m_lstDig.Add(aitem); } if (iShow99 > 0) { for (int i = 0; i < iShow99; i++) { SevenSegmentSplick aitem = new SevenSegmentSplick(); if (bEnableMdy) { aitem.BSplickAble = true; } else { aitem.BSplickAble = false; } aitem.Location = new Point(iPosx, iPosy); aitem.Padding = new Padding(2, 2, 2, 2); aitem.Size = szApp; aitem.Value = "8"; Controls.Add(aitem); iPosx += iAppend99Width; m_lstDig.Add(aitem); } } else { if (bShow10_9) { SevenSegmentSplick aitem = new SevenSegmentSplick(); aitem.Padding = new Padding(4, 4, 4, 4); aitem.BSplickAble = false; aitem.ColorDark = System.Drawing.Color.FromArgb(32, 29, 38); aitem.Location = new Point(iPosx + iAppend99Width, iPosy); aitem.Size = szApp; aitem.Value = "9"; Controls.Add(aitem); Panel apline = new Panel(); apline.Location = new Point(iPosx + 6, iMainDigHeigh / 2); apline.Size = new Size(iAppend99Width * 2 - 6, 2); apline.BackColor = Color.Red; Controls.Add(apline); iPosy += iMainDigHeigh / 2 + 1; aitem = new SevenSegmentSplick(); aitem.Padding = new Padding(4, 4, 4, 4); aitem.BSplickAble = false; aitem.Location = new Point(iPosx, iPosy); aitem.ColorDark = System.Drawing.Color.FromArgb(32, 29, 38); aitem.Size = szApp; aitem.Value = "1"; Controls.Add(aitem); iPosx += iAppend99Width; aitem = new SevenSegmentSplick(); aitem.Padding = new Padding(4, 4, 4, 4); aitem.BSplickAble = false; aitem.Location = new Point(iPosx, iPosy); aitem.ColorDark = System.Drawing.Color.FromArgb(32, 29, 38); aitem.Size = szApp; aitem.Value = "0"; Controls.Add(aitem); } } }