在窗体中画文字
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(80,80);
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = this.CreateGraphics();//先扯画布
g.DrawString("www.sikiedu.com-siki学院",
new Font("隶书",20),//指定字体
new SolidBrush(Color.Red),//指定颜色
new Point(100, 100)); //指定起始坐标
}
}
演示结果:
