T
Tony Johansson
Hi!
If I have these code lines I can skip creating the instances for Pen and
Brush by using the static Pens and Brushes.
So my question is if there actually is any point to create an instance for
Pen and Brush as my example shows ?
I have this code
Brush lb = new SolidBrush(Color.White);
Pen lp = new Pen(Color.Black, 1);
g.FillRectangle(lb, lRect);
g.DrawRectangle(lp, lRect);
but I can use the static Pens and Brushes instead in this way
g.FillRectangle(Brushes.White, lRect);
g.DrawRectangle(Pens.Black, lRect);
//Tony
If I have these code lines I can skip creating the instances for Pen and
Brush by using the static Pens and Brushes.
So my question is if there actually is any point to create an instance for
Pen and Brush as my example shows ?
I have this code
Brush lb = new SolidBrush(Color.White);
Pen lp = new Pen(Color.Black, 1);
g.FillRectangle(lb, lRect);
g.DrawRectangle(lp, lRect);
but I can use the static Pens and Brushes instead in this way
g.FillRectangle(Brushes.White, lRect);
g.DrawRectangle(Pens.Black, lRect);
//Tony