Results 1 to 3 of 3

Thread: [RESOLVED] Error when adding image to cmdbutton (part2)

  1. #1
    Shurijo
    Guest

    Resolved [RESOLVED] Error when adding image to cmdbutton (part2)

    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.

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    are you creating a reource object

    Code:
    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)
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    or actually make sure there is something similar to that. I dont use Visual Studio so that always throws me off.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width