public SysInfoPanel() { Text = "System Information: Panel"; BackColor = SystemColors.Window; ForeColor = SystemColors.WindowText; AutoScroll = true; Graphics grfx = CreateGraphics(); SizeF sizef = grfx.MeasureString(" ", Font); cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font); cySpace = Font.Height; // Create a panel. Panel panel = new Panel(); panel.Parent = this; panel.Paint += new PaintEventHandler(PanelOnPaint); panel.Location = Point.Empty; panel.Size = new Size( (int)Math.Ceiling(cxCol + SysInfoStrings.MaxValueWidth(grfx, Font)), (int)Math.Ceiling(cySpace * SysInfoStrings.Count)); grfx.Dispose(); }
public SysInfoPanel() { Text = "System Information with Panel"; BackColor = SystemColors.Window; ForeColor = SystemColors.WindowText; AutoScroll = true; AutoScrollMargin = new Size(10, 10); Graphics grfx = CreateGraphics(); SizeF sizef = grfx.MeasureString(" ", Font); cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font); cySpace = Font.Height; //Создаём панель Panel panel = new Panel(); panel.Parent = this; panel.Paint += new PaintEventHandler(PanelOnPaint); panel.Location = Point.Empty; panel.Size = new Size((int)Math.Ceiling(cxCol + SysInfoStrings.MaxValueWidth(grfx, Font)), cySpace * SysInfoStrings.Count); // test panel.BackColor = Color.Honeydew; panel.Move += new EventHandler(PanelOnMove); grfx.Dispose(); }
private void UpdateAllInfo() { iCount = SysInfoStrings.Count; astrLabels = SysInfoStrings.Labels; astrValues = SysInfoStrings.Values; Graphics grfx = CreateGraphics(); SizeF sizef = grfx.MeasureString(" ", Font); cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font); cySpace = Font.Height; AutoScrollMinSize = new Size((int)Math.Ceiling(cxCol + SysInfoStrings.MaxValueWidth(grfx, Font)), cySpace * iCount); grfx.Dispose(); }
public SysInfoScroll() { Text = "System Information Scroll"; BackColor = SystemColors.Window; ForeColor = SystemColors.WindowText; Graphics grfx = this.CreateGraphics(); SizeF sizef = grfx.MeasureString(" ", Font); cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font); cySpace = Font.Height; // Устанавливаем свойства автопрокрутки AutoScroll = true; AutoScrollMinSize = new Size( (int)Math.Ceiling(cxCol + SysInfoStrings.MaxValueWidth(grfx, Font)), SysInfoStrings.Count * cySpace); grfx.Dispose(); }
public SysInfoScroll() { Text = "System Information: Scroll"; BackColor = SystemColors.Window; ForeColor = SystemColors.WindowText; Graphics grfx = CreateGraphics(); SizeF sizef = grfx.MeasureString(" ", Font); cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font); cySpace = Font.Height; // Set auto-scroll properties. AutoScroll = true; AutoScrollMinSize = new Size( (int)Math.Ceiling(cxCol + SysInfoStrings.MaxValueWidth(grfx, Font)), (int)Math.Ceiling(cySpace * SysInfoStrings.Count)); grfx.Dispose(); }