class Empty
{
public static void Main()
{
Form f = new Form();
f.BackColor = Color.White;
f.Paint += new PaintEventHandler(MyPaintHandler);
Application.Run(f);
}
static void MyPaintHandler(object objSender, PaintEventArgs pea)
{
Form form = (Form)objSender;
Graphics grfx = pea.Graphics;
form.Font.Size = 50.0f;//这里不能编译,提示是只读的。
grfx.DrawString("Hello, World", form.Font, Brushes.Black, 0, 0);
}
}
{
public static void Main()
{
Form f = new Form();
f.BackColor = Color.White;
f.Paint += new PaintEventHandler(MyPaintHandler);
Application.Run(f);
}
static void MyPaintHandler(object objSender, PaintEventArgs pea)
{
Form form = (Form)objSender;
Graphics grfx = pea.Graphics;
form.Font.Size = 50.0f;//这里不能编译,提示是只读的。
grfx.DrawString("Hello, World", form.Font, Brushes.Black, 0, 0);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货