Csharp/C Sharp by API/System.Windows.Forms/PaintEventArgs

Материал из .Net Framework эксперт
Версия от 15:09, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

PaintEventArgs.Graphics

<source lang="csharp"> using System; using System.Drawing; using System.Windows.Forms;

class SeparateMain {

    public static void Main()
    {
         Application.Run(new AnotherHelloWorld());
    }

} class AnotherHelloWorld: Form {

    public AnotherHelloWorld()
    {
         Text = "Another Hello World";
         BackColor = Color.White;
    }
    protected override void OnPaint(PaintEventArgs pea)
    {
         Graphics graphics = pea.Graphics;
  
         graphics.DrawString("Hello, Windows Forms!", Font,
                         Brushes.Black, 0, 0);
    }

}

</source>