B
Bruce C. Miller
This might be an easy one (just starting to learn C# here), but I'm
overlooking it for some reason...
namespace test2
{
public class Form1 : System.Windows.Forms.Form
{
public Graphics g;
private Thread t1;
// some other code
private void Form_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
g = e.Graphics;
Trace.WriteLine(g.RenderingOrigin.ToString());
t1 = new Thread(new ThreadStart(Wait));
t1.Start();
}
public void Wait()
{
Trace.WriteLine(g.RenderingOrigin.ToString()); //runtime error
}
}
}
I get a System.ArgumentException when the second Trace is performed.
overlooking it for some reason...
namespace test2
{
public class Form1 : System.Windows.Forms.Form
{
public Graphics g;
private Thread t1;
// some other code
private void Form_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
g = e.Graphics;
Trace.WriteLine(g.RenderingOrigin.ToString());
t1 = new Thread(new ThreadStart(Wait));
t1.Start();
}
public void Wait()
{
Trace.WriteLine(g.RenderingOrigin.ToString()); //runtime error
}
}
}
I get a System.ArgumentException when the second Trace is performed.