GUI problem - Getting "ObjectDisposedException"

hi,
i need help in NETMF GUI application

i am using NETMF classes using Microsoft.SPOT.Presentation.RichMediaControls in SDK 4.2 framwork
i am using FEZ Cobra board

i am getting “ObjectDisposedException” exception while i load page, second time

my code is as follows

[line]



// public initialization
private Bitmap screen;
private Bitmap bg = Resources.GetBitmap(Resources.BitmapResources.bg_Num1);
// public initialization
    
// In constructor
screen = new Bitmap(250, 350);
this.Width = 250;
this.Height = 350;
this.SetMargin(10, 40, 11, 25);
// In constructor

                
// In DrawSettings function
DrawSettings();

private void DrawSettings()
 {
     screen.Clear();  
     screen.DrawImage(0, 0, bg, 0, 0, 250, 350); 
     screen.DrawImage(btn1.X, btn1.Y, btn1.Image, 0, 0, btn1.Width, btn1.Height);
 }             
// In DrawSettings function


// In OnRender() intrupt
 public override void OnRender(DrawingContext dc)
 {
       dc.DrawImage(screen, 0, 0);
 }
// In OnRender() intrupt


[line]
“bg” image height is 350 and width is 250

i am getting above exception in “DrawSettings” function at line 1
i am getting above exception in “DrawSettings” function at line 2 because “bg” image contains null

i dont know how to resolve this problem
can anybody help me urgently ?

Use the code button. Edit your post (pencil icon) and highlight your code and use the 101010 button near the top, and resubmit it. And please use your full code so we can see what you’re doing. The exception tells you what is wrong - you have disposed of an object that you’re trying to use. We’ll need to see REAL code not this stuff that you’ve put comments in.