my program is a CRM, I used Rad Ribbon Bar, so Many Buttons with images, RadGridView (which some columns contain images) and so many other controls which contain images. It's a mdi parent/child program. In so many cases while loading a mdi child or working with some grid views the program will hang and give me this error:
OutOfMemoryException occurred in System.Drawing.dll
I can not find where and which image causes this error, nothing will show just the error title.
I tried GC.Collect()
on certain parts but no success.
So How can I find which image or control is causing this problem or how can I clear all images from the memory before loading a mdi child?
UPDATED:
as for codes, really for setting images there is no code! for example for setting an image for a button I used its properties in visual studio. I have set All other control images in this way using the properties panel in visual mode.
and These are some designer codes related to drawing:
this.backStage.Size = new System.Drawing.Size(1151, 625);
this.MainRibbonBar.Font = new System.Drawing.Font("B Nazanin", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(178)));
this.btnCustomerList.Image = global::MihmanyCRM.Properties.Resources.CustomerList32;
gridViewCommandColumn1.Image = global::MihmanyCRM.Properties.Resources.ViewShop32;