VB6 --> VB,NET

G

Guest

Hi All
I'm making an upgrade of a program developed in VB6 to VB.NET and I've found
among other many problems one with the upgrade of the objects "ImageList"
I've an object ImageList in a form to which in design I've put the images
that we have available in the whole application
Then in other form I put in run-time another object ImageList into which I
incorporate the images from primary ImageList that are used in the form
On having used the "Upgrade Wizard" it does not give any compilation error .
The objects ImageList AxMSComctlLib defines as "AxMSComctlLib.AxImageList"
When I execute the program and it comes to the instruction of adding the
image the following mistake is produced:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in Project1.exe

Additional information: Property is read-only

The code in VB.NET executing is:

Dim picImage As MSComctlLib.IImage

With imlaux
..ListImages.Clear()
..ImageHeight = imgImages.ImageHeight
..ImageWidth = imgImages.ImageWidth
..UseMaskColor = imgImages.UseMaskColor
..BackColor = imgImages.BackColor
..MaskColor = imgImages.MaskColor
End With
With imlaux.ListImages

For Each picImage In imgImages.ListImages
Call .Add(, picImage.Key, picImage.Picture)
Next picImage


where 'imlaux' is empty ImageList and 'imgImages' is primary ImageList
by design I should not use the new object ImageList of .NET
(System.Windows.Forms.ImageList)
Has someone any trick for me that could help with this problem? I am driven
to despair, thank you in advance
 

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