CellPicture Property Example

The following example loads icons from the Visual Basic icon library into two cells within an MSHFlexGrid. You can use any two icons. Paste the code into the Declarations section of a form that contains the MSHFlexGrid. Press f5 to run the program, and then click the form.

Private Sub Form_Click ()
   ' Load the icons.
   MSHFlexGrid1.Row =1
   MSHFlexGrid1.Col =1
   Set MSHFlexGrid1.CellPicture =_
   LoadPicture("Icons\Computer\Trash02a.ico")
   MSHFlexGrid1.Row =1
   MSHFlexGrid1.Col =2
   Set MSHFlexGrid1.CellPicture =_
   LoadPicture("Icons\Computer\Trash02b.ico")
End Sub