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

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 !!! :=)
 
E

Ed Kaim [MSFT]

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.
 

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