本文介绍了如何在Form_Load的表单中绘制一条线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Form上从一个点到另一点画一条线,并在Form_Load()事件(不使用Paint事件)中对其进行编码:
I want to draw a line from one point to another on a Form and code it in Form_Load() event (not use Paint event):
private void Form1_Load(object sender, EventArgs e)
{
Pen pen = new Pen(Brushes.Blue,1);
Graphics m = this.CreateGraphics();
m.DrawLine(pen, 0, 0, 100, 100);
}
但是当我跑步时,我没有任何结果!为什么?希望你能帮助我解决这个问题.谢谢.
But when i run, i dont get any result! Why? Hope you help me solve this problem. Thanks.
推荐答案
这篇关于如何在Form_Load的表单中绘制一条线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!