ListView, ImageList et InvalidOperationException
Bonsoir,
Cela fait quelque heures que je cherche désespérément d'oû pourrait venir un problème qui ne mettais pour l'instant jamais encore arrivé.
J'ai donc une imageList contenant ~3000 images ( 50x50, 32 bits )
Lors d'un clic sur mon bouton je veut donc charger ma ListView, j'affecte donc mon ImageList à ma ListView
Code:
1 2
|
maListView.LargeImageList = monImageList |
Et là, Erreur :aie:
InvalidOperationException avec un beau message explicite :mouarf:
Citation:
L'image ne peut pas être ajoutée à l'ImageList.
Un petit aperçu de la StackTrace
Citation:
à System.Windows.Forms.ImageList.AddToHandle(Original original, Bitmap bitmap)
à System.Windows.Forms.ImageList.CreateHandle()
à System.Windows.Forms.ImageList.get_Handle()
à System.Windows.Forms.ListView.set_LargeImageList(ImageList value)
à YggEditor.WorkSpaceForm.BtnObjets_Click(Object sender, EventArgs e) dans C:\Users\Jérémy\Documents\Visual Studio 2010\Projects\Others\YggEditor\YggEditor\Formulaires\WorkSpaceForm.cs:ligne 435
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ButtonBase.WndProc(Message& m)
à System.Windows.Forms.Button.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
à System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
à System.Windows.Forms.Application.RunDialog(Form form)
à System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
à System.Windows.Forms.Form.ShowDialog()
à YggEditor.LoadingForm.<Loaded>b__5() dans C:\Users\Jérémy\Documents\Visual Studio 2010\Projects\Others\YggEditor\YggEditor\Formulaires\LoadingForm.cs:ligne 83
Si vous avez une quelconque idée d'ou cela pourrai venir je vous en serez éternellement reconnaissant :D