[求助]请问:高手呢,再给点建议呀!
我原来在groupBox中定义了一个graphics对象,在timer_tick中画图,结果总报错:参数错误异常。各位高手有什么好见意?先谢了。
[此贴子已经被作者于2007-9-12 16:02:36编辑过]
谢谢你的答复。问题是不能在groupBox7中画图,如果是在Form1中定义graphics对象,那么是可以的。但是我想在groupBox7中画图。再帮我想想?怎么解决?谢谢!
public partial class Form1 : Form
{
PortControl MB = new PortControl();
Graphics g;
public Form1()
{
InitializeComponent();
}
private void groupBox7_Paint(object sender, PaintEventArgs e)
{
g = e.Graphics;
......
}
private void timer1_Tick(object sender, EventArgs e)
{
.......
g.DrawLine(new Pen(new SolidBrush(Color.Red), 1), 25,41,12,19);//报错:参数错误
.......
}
[此贴子已经被作者于2007-9-12 12:41:00编辑过]