I'm using a flexgrid where I display different events, and I want to add icons to them.

Since each event can fill several cells that are then merged, I must (AFAIK) iterate through all those cells and set their cellpicture, so the picture can be seen in the merged cell. For example:

VB Code:
  1. With Me.MSFlexGrid1
  2.     .Col = 5
  3.     For i = 2 to 7
  4.         .Row = i
  5.         Set .CellPicture = LoadPicture(App.Path & "\icon.ico")
  6.     Next
  7. End With

However doing this is rather slow when I must set the picture of a lot of cells. Is there a faster way of formatting the cells?

I've also adapted my code so I can add different categories for each event and so give them a different background colour, I haven't tested it yet, but it requires using the same method as far as I know.