Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. Warning: VS.Net and ImageLists on XP

Warning: VS.Net and ImageLists on XP

Scheduled Pinned Locked Moved Visual Studio
helpcsharpvisual-studioquestion
1 Posts 1 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard DeemingR Offline
    Richard DeemingR Offline
    Richard Deeming
    wrote on last edited by
    #1

    [NB: This is not a programming question!] This problem has just had me tearing my hair out for a couple of hours, so I thought I'd share the solution. As you probably know, if you're running VS.Net on Windows XP, you can add a manifest to the "devenv.exe" file to make VS use the new XP themed controls. This looks really great, especially when you're designing a form. :) The problem starts when you add an ImageList to your form, with one or more images, of any format, colour-depth, etc., in the list. When you try to run your app, you will get the error:

    Exception has been thrown by the target of an invocation.

    on the line:

    this.imageList1.ImageStream =
    ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));

    It doesn't matter which language you use, the error will always occur. :( It turns out that the manifest on devenv causes the ImageList to be saved in a different format, which is not backwards-compatible with the common controls prior to v6. :mad: To solve the problem, you can either:

    • on XP, define a manifest for your application; [The app still won't work on any earlier OS.]
    • Remove the manifest from devenv, and re-create all of your image-lists;

    Hope this saves some headaches!

    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups