I have a toolbar and an imagelist control assigned to it. I load images into the imagelist and create buttons in the toolbar in runtime.

Dim listimg_temp As ListImage
Set listimg_temp = ImageList1.ListImages.Add(...)

Dim btn As Button
Set btn = Toolbar1.Buttons.Add(...)

but sometimes I need to clear both of them and recreate them in runtime again.

Toolbar1.Buttons.Clear
ImageList1.ListImages.Clear 'ERROR! why? and how to solve this?

plz help