PDA

Click to See Complete Forum and Search --> : Error when adding image to cmdbutton (part2)


Shurijo
Jul 31st, 2002, 10:05 AM
I am not allowed to post any replys or upload any images, I have been trying to reply to my earlier posts all week and just keep getting error messages from the forum. I figured out that I can post new threads, but not reply to existing ones.

I had an image attached, but I don't think that was uploaded on the last post.

The error says:

--- Microsoft Development Environment
An unhandled exception of type
'System.Resources.MissingManifestResourceException' occurred in
mscorlib.dll

Additional Information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assemly. Make sure "MainForm.resources" was correctly embedded or linked into assembly "LicenseTool".
baseName: MainForm
locationInfo: LicenseTool.MainForm
resource filename: MainForm.resources
assembly: LicenseTool, Version=1.0.942.12641, Culture=neutral, PublicKeyToken=null

{break} {continue} { } {help}

-----------------------------------

Then it takes me to the code of my MainForm form into the section that begins

'cmdRefresh
'
Me.cmdRefresh.Image = CType(resources.GetObject("cmdRefresh.Image"), System.Drawing.Bitmap)

-------------------------

cmdRefresh is my command button with the image
MainForm is my form that contains cmdRefresh

The section of code above is located in the "Windows Form Designer generated code" section, and I haven't messed with anything inside here.

Cander
Jul 31st, 2002, 10:15 AM
are you creating a reource object


Public rm As System.Resources.ResourceManager = New System.Resources.ResourceManager("ImageResources", System.Reflection.Assembly.GetExecutingAssembly())

Me.cmdRefresh.Image = CType(rm.GetObject("cmdRefresh.Image"), System.Drawing.Bitmap)

Cander
Jul 31st, 2002, 10:16 AM
or actually make sure there is something similar to that. I dont use Visual Studio so that always throws me off.