[此贴子已经被作者于2007-9-12 16:06:40编辑过]
按你的意思,程序应该是这样写吗?
public partial class Form1 : Form
{
Graphics g;
public Form1()
{
InitializeComponent();
}
private void groupBox7_Paint(object sender, PaintEventArgs e)
{
//g = GRAPHICS。FROMHANDLE(groupBox7.HANDLE);//内存不足
......
}
private void timer1_Tick(object sender, EventArgs e)
{
//g = GRAPHICS。FROMHANDLE(groupBox7.HANDLE);//内存不足
g.DrawLine(new Pen(new SolidBrush(Color.Red), 1), 25,41,12,19);
g。DISPOSE();)
.......
}
[此贴子已经被作者于2007-9-12 16:34:30编辑过]
注意大小写,什么意思?我这里只是表示一下,其实我是这样写的:
public partial class Form1 : Form
{
Graphics g;
public Form1()
{
InitializeComponent();
}
private void groupBox7_Paint(object sender, PaintEventArgs e)
{
//g = Graphics.Graphics.FromHdc(groupBox7.Handle );;//内存不足
......
}
private void timer1_Tick(object sender, EventArgs e)
{
//g = Graphics.Graphics.FromHdc(groupBox7.HANDLE);//内存不足
g.DrawLine(new Pen(new SolidBrush(Color.Red), 1), 25,41,12,19);
g.Dispose();
}