示例#1
0
 private void HMIForm_Scroll(object sender, ScrollEventArgs e)
 {
     if (Framework.IsStudioMode)
     {
         ShowDebugMessage(AutoScrollPosition.ToString());
         Invalidate();
     }
 }
示例#2
0
    void PanelOnPaint(object obj, PaintEventArgs pea)
    {
        Graphics grfx  = pea.Graphics;
        Brush    brush = new SolidBrush(ForeColor);

        int iCount = SysInfoStrings.Count;

        string[] astrLabels = SysInfoStrings.Labels;
        string[] astrValues = SysInfoStrings.Values;

        for (int i = 0; i < iCount; i++)
        {
            grfx.DrawString(astrLabels[i], Font, brush, 0, cySpace * i);
            grfx.DrawString(astrValues[i], Font, brush, cxCol, cySpace * i);
        }

        // test Выводим данные свойств класса ScrollableControl, наследуемого экземпляром panel
        grfx.DrawString(HScroll.ToString(), Font, brush, 400, 100);
        grfx.DrawString(VScroll.ToString(), Font, brush, 426, 100);
        grfx.DrawString(AutoScrollPosition.ToString(), Font, brush, 400, 100 + cySpace);
    }