/*★ Form を継承した MyForm で TEXT を表示する 前田 稔 ★*/
using System;
using System.Drawing;
using System.Windows.Forms;
public class MyForm : Form
{
public MyForm()
{
Paint += new PaintEventHandler(MyHandler);
}
private void MyHandler(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Font f = new Font("MS 明朝", 80);
g.DrawString("C#", f, Brushes.Red, new PointF(10F, 50F));
}
}
class form01
{
public static void Main()
{
MyForm mf = new MyForm();
Application.Run(mf);
}
}
|
>CD C:\Data\C#\BAT\win >CSC Text.cs >Text.exe |
![]()