is it possible to display picture from folder in a grid? if it is what type of grid is used for it
Printable View
is it possible to display picture from folder in a grid? if it is what type of grid is used for it
Do you mean as the background, or in a cell on the grid, or to display a picture based on a grid (like a file location) ?
there may be one or more pictures in the folder. if there is three pictures in a folder i want to display it in three cells in a grid
You can use a MSFlexgrid.Quote:
Originally Posted by binilmb
Check this example to assign a Picture (loaded from file) to all cells in a column:
Code:Option Explicit
Private Sub SetColPicture(pColumn As Long, pPic As Picture)
With MSFlexGrid1
.FillStyle = flexFillRepeat 'This is to apply to the selection
.Row = 1
.Col = pColumn
.RowSel = .Rows - 1
.ColSel = pColumn
Set .CellPicture = pPic
.FillStyle = flexFillSingle 'Change back to fillsingle
End With
End Sub
Private Sub Command1_Click()
Dim i As Long
'Set the Row height in a loop..
For i = 1 To MSFlexGrid1.Rows - 1
MSFlexGrid1.RowHeight(i) = 400
Next
'Format: SetColPicture <ColumnNumber>,<Picture>
SetColPicture 1, LoadPicture("c:\windows\soap bubbles.bmp")
End Sub
Oh, you don't want the full column, to it's easier, somethihg like..
Code:With MSFlexGrid1
.Row = 1: .Col = 1
.RowHeight(1) = 400 'The height you want
Set .CellPicture = LoadPicture("c:\Pic1.JPG")
.Row = 2: .Col = 1
.RowHeight(2) = 400 'The height you want
Set .CellPicture = LoadPicture("c:\Pic2.JPG")
.Row = 3: .Col = 1
.RowHeight(3) = 400 'The height you want
Set .CellPicture = LoadPicture("c:\Pic3.JPG")
End With