C# - Problem´s changing the ImageSize (ImageList)

  • Thread starter Thread starter SpaceMind
  • Start date Start date
S

SpaceMind

Hi, I´m using this code for changing the size property of an ImageList :
ImageList.ImageSize = new Size(32,32);

However , the Icon property just lost´s his data.

Before code:

ImageList.Images.Count == 1

After:

ImageList.Images.Count == 0

Anyone have an idea ???

PS: The image it´s an ICO with 16x16 and 32x32. It work´s if I change the
imageSize at design time.

Sorry about my poor english and Thanks !!! :=)
 
All images in an ImageList are expected to be the same size (or will be fit
into it when added). Changing the size resets the ImageList If you need to
programmatically resize the ImageSize property, do it before adding the
images.
 
Back
Top