How to set imagelist size in code?

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

Probably easy, but the following does not work:
Dim imgLarge As New ImageList

imgLarge.ColorDepth = ColorDepth.Depth32Bit 'ok

imgLarge.ImageSize(64, 64) 'nope

imgLarge.ImageSize.Height = 64 'nope, get property only



Thanks,

Dean Slindee
 
* "Dean Slindee said:
Probably easy, but the following does not work:
Dim imgLarge As New ImageList

imgLarge.ColorDepth = ColorDepth.Depth32Bit 'ok

imgLarge.ImageSize(64, 64) 'nope

imgLarge.ImageSize.Height = 64 'nope, get property only

'imgLarge.ImageSize = New Size(64, 64)'.
 
Dean,
As the others have pointed out, you set the you set the ImageSize property
to a new Size structure

imgLarge.ImageSize = New Size(64, 64)'.

However this will cause your images too be lost (as they are all the wrong
size now). You will need to re-add your images. In other words,
understandable, this does not cause the contained images to be scaled to the
new size.

Hope this helps
Jay
 
Back
Top