Problems with Toolbar ImageList

G

Guest

Hello,

I have a VB.NET app that uses the standard .NET controls + a WebBrowser
control for the interface. I've added an ImageList (imlToolbar) to my form
and assigned it to the Toolbat (tlbMain). The ImageList contains 3 16x16 .gif
images.
Now I can assign the Toolbar Buttons their appropriate images but when I
attemp to run in debug mode, I get the following error:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll

Unhandled Exception: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.InvalidOperationException: Failed to load ImageList.
at System.Windows.Forms.ImageListStreamer..ctor(SerializationInfo info,
StreamingContext context)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object
target, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context)
at
System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializatThe program '[2276] SWATview.exe' has exited with code 0 (0x0).
ionStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage
methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.Resources.ResourceReader.LoadObject(Int32 pos)
at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean
ignoreCase)
at System.Resources.ResourceManager.GetObject(String name, CultureInfo
culture)
at System.Resources.ResourceManager.GetObject(String name)

My system is running the following: Windows XP SP2 with Framework ver 1.1
using Visual Studio.NET 2002.

Any help would be greatly appreciated.
Thank you
 
G

Guest

Ok I was able to get it to work by including a manifest that uses ver 6 of
Common Controls, however I'm wondering if this will still work on non XP
systems?

Again, anyhelp would be appreciated.
 
H

Herfried K. Wagner [MVP]

Chavez said:
I have a VB.NET app that uses the standard
.NET controls + a WebBrowser control for the
interface. I've added an ImageList (imlToolbar)
to my form and assigned it to the Toolbat (tlbMain).
The ImageList contains 3 16x16 .gif images.
Now I can assign the Toolbar Buttons their appropriate
images but when I attemp to run in debug mode, I
get the following error:
An unhandled exception of type
'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll

Unhandled Exception: System.Reflection.TargetInvocationException:
Exception
has been thrown by the target of an invocation. --->
System.InvalidOperationException: Failed to load ImageList.
at System.Windows.Forms.ImageListStreamer..ctor(SerializationInfo info,

I assume you are using a manifest file with your "devenv.exe" in order to
see visual styles within the IDE. Remove the manifest file and then
recreate the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top