|
-
Feb 2nd, 2006, 01:24 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] display picture from folder in a grid
is it possible to display picture from folder in a grid? if it is what type of grid is used for it
-
Feb 2nd, 2006, 01:27 AM
#2
Re: display picture from folder in a grid
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) ?
-
Feb 2nd, 2006, 02:01 AM
#3
Thread Starter
Hyperactive Member
Re: display picture from folder in a grid
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
-
Feb 2nd, 2006, 02:04 AM
#4
Re: display picture from folder in a grid
 Originally Posted by binilmb
there may to 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.
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
-
Feb 2nd, 2006, 02:09 AM
#5
Re: display picture from folder in a grid
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|