Example #1
0
    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();
    }
Example #2
0
    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();
    }
Example #3
0
    public SysInfoList()
    {
        Text      = "System Information List";
        BackColor = SystemColors.Window;
        ForeColor = SystemColors.WindowText;

        Graphics grfx  = CreateGraphics();
        SizeF    sizef = grfx.MeasureString(" ", Font);

        cxCol = sizef.Width + SysInfoStrings.MaxLabelWidth(grfx, Font);
        grfx.Dispose();
        cySpace = Font.Height;
    }
Example #4
0
    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();
    }
Example #5
0
    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();
    }
Example #6
0
    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();
    }