vb6imagemsflexgrid

Print msflexgrid with picture in cell in VB6


How do I print msflexgrid with a picture in some of its cells in VB6?


Solution

  • I think you have to first select the grid cell, optionally set the cell picture alignment, then load the picture using either LoadPicture (if you are using a file path to a picture on disk) or preferably LoadResPicture (if you are using a picture in a resource file) e.g.

      With MSFlexGrid1
        .Row = 1
        .Col = 1
        .RowSel = 1
        .ColSel = 1
        .CellAlignment = flexAlignCenterCenter
        Set .CellPicture = LoadPicture("C:\My Pictures\Me.bmp")
        ' Alternatively:
        ' Set .CellPicture = LoadResPicture(MY_PROFILE_PIC_ID)
      End With