Hi all
I have the same problem.
I am workin on a software developped in
2005, so it s either VS2003 or VS2005 (language C#). I upgraded it to
2008.
It is always the same exception on the main form where I am using the
imagelists. One of them has 13 images, but it keeps reading only 11.
I get the following exception on the
designer generated code.
System.IndexOutOfRangeException
was unhandled
Message="Index was outside the
bounds of the array."
Source="System.Windows.Forms"
StackTrace:
at
System.Windows.Forms.ImageList.ImageCollection.SetKeyName(Int32 index, String
name)
at
EmisBuilder.Form1.InitializeComponent() in C:\Documents and Settings\s_kaouk\My
Documents\Emis\26-3-2009\EmisBuilder2.0.1\Form1.cs:line
1601
at
EmisBuilder.Form1..ctor() in C:\Documents and Settings\s_kaouk\My
Documents\Emis\26-3-2009\EmisBuilder2.0.1\Form1.cs:line
433
at
EmisBuilder.Form1.Main() in C:\Documents and Settings\s_kaouk\My
Documents\Emis\26-3-2009\EmisBuilder2.0.1\Form1.cs:line
3651
at
System.AppDomain._nExecuteAssembly(Assembly assembly, String[]
args)
at
System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity,
String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at
System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)
at
System.Threading.ThreadHelper.ThreadStart()
InnerException:
It gives the exception on the
setkey(11,"")
//
imActions
//
this.imActions.ImageStream =
((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imActions.ImageStream")));
this.imActions.TransparentColor =
System.Drawing.Color.Transparent;
this.imActions.Images.SetKeyName(0, "");
this.imActions.Images.SetKeyName(1, "");
this.imActions.Images.SetKeyName(2, "");
this.imActions.Images.SetKeyName(3, "");
this.imActions.Images.SetKeyName(4, "");
this.imActions.Images.SetKeyName(5, "");
this.imActions.Images.SetKeyName(6, "");
this.imActions.Images.SetKeyName(7, "");
this.imActions.Images.SetKeyName(8, "");
this.imActions.Images.SetKeyName(9, "");
this.imActions.Images.SetKeyName(10, "");
this.imActions.Images.SetKeyName(11, "");
this.imActions.Images.SetKeyName(12, "");
I have added int
toto=this.imActions.Images.Count; it gives me the value 11 and not
13.
I also tried to remove the
existed reference System.Windows.Forms with the one of version 2.0.0.0 but it
didn’t work as well
Please help