在窗體中畫文字
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學(xué)院",
? ? ? ? ? ? ? ? new Font("隸書",20),//指定字體
? ? ? ? ? ? ? ? new SolidBrush(Color.Red),//指定顏色
? ? ? ? ? ? ? ? new Point(100, 100)); //指定起始坐標(biāo)
? ? ? ? }
}
演示結(jié)果:

標(biāo)簽: