I have a class in which I override OnPaint
for the control Button
, and it gives me an error that
Graphics G does not exist in current context
yet I have Graphics G defined.
abstract class ThemeContainer154 : Control
{
#region " Initialization "
protected Graphics G;
protected Bitmap B;
public ThemeContainer154()
{
SetStyle((ControlStyles)139270, true);
_ImageSize = Size.Empty;
Font = new Font("Verdana", 8);
MeasureBitmap = new Bitmap(1, 1);
MeasureGraphics = Graphics.FromImage(MeasureBitmap);
DrawRadialPath = new GraphicsPath();
InvalidateCustimization();
}
And here is the "Theme":
class NSButton : Control
{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
G = e.Graphics;
G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
G.Clear(BackColor);
G.SmoothingMode = SmoothingMode.AntiAlias;
}
}
The errors I get are:
The name 'G' does not exist in the current context