zswang, I have coyied the code to program, but nothing display. Is there any code needed? Thanks.(I am in university lab, the system is in English,so...)
将代码放到Form1的Paint事件里执行private void button1_Click(object sender, EventArgs e) { Graphics vGraphics = Graphics.FromHwnd(Handle); vGraphics.DrawLine(Pens.Black, new Point(0, ClientSize.Height / 2), new Point(ClientSize.Width, ClientSize.Height / 2)); vGraphics.DrawLine(Pens.Black, new Point(ClientSize.Width / 2, 0), new Point(ClientSize.Width / 2, ClientSize.Height)); }简单来说就是通过Graphics类的DrawLine()方法绘制直线
{
e.Graphics.DrawLine(Pens.Black, new Point(0, ClientSize.Height / 2),
new Point(ClientSize.Width, ClientSize.Height / 2));
e.Graphics.DrawLine(Pens.Black, new Point(ClientSize.Width / 2, 0),
new Point(ClientSize.Width / 2, ClientSize.Height)); //todo : 其他绘制
}
http://blog.csdn.net/tjvictor/archive/2006/11/24/1412546.aspx
Is there any code needed?
Thanks.(I am in university lab, the system is in English,so...)
{
Graphics vGraphics = Graphics.FromHwnd(Handle);
vGraphics.DrawLine(Pens.Black, new Point(0, ClientSize.Height / 2),
new Point(ClientSize.Width, ClientSize.Height / 2));
vGraphics.DrawLine(Pens.Black, new Point(ClientSize.Width / 2, 0),
new Point(ClientSize.Width / 2, ClientSize.Height));
}简单来说就是通过Graphics类的DrawLine()方法绘制直线
回复 | 收藏此页 | 专题 | 公告 | [[[[管理]]]]] | 保存 | 关闭窗口 点上面的[管理]按提示给分 -.-#