|
-
August 29th, 2001, 03:08 AM
#1
MSHFlexGrid
Can someone PLEASE tell me how to put an image into an MSHFlexGrid cell?
I have tried MSHFlexGrid1.cellpicture=loadpicture(picturename) but all I get "Compiler Error, Invalid Use Of Property"
HELP, I am going out of my mind over this.
-
August 29th, 2001, 04:02 AM
#2
Re: MSHFlexGrid
u please check what is the celltype property for that flexgrid or else set the cellytpe property of either celltypepic/celltypebutton and then you check should be ok
-
August 29th, 2001, 07:02 AM
#3
Re: MSHFlexGrid
Sub AddPicToCell(flex As MSFlexGrid, row As Long, col As Long, pic As stdole.StdPicture)
flex.row = row
flex.col = col
Set flex.CellPicture = pic
End Sub
Private Sub Command1_Click()
AddPicToCell MSFlexGrid1, 0, 0, Picture1.Picture
End Sub
Iouri Boutchkine
[email protected]
-
August 29th, 2001, 07:02 AM
#4
Re: MSHFlexGrid
Another example
' pictures that we want to enter to the MSFG are on the form (imgItems)
Private Sub Form_Load()
'------------------------
Const NUM_ROWS = 10
Dim i As Integer
flxItems.Rows = NUM_ROWS
flxItems.Cols = 2
flxItems.FixedRows = 0
flxItems.FixedCols = 0
flxItems.GridLines = flexGridNone
flxItems.SelectionMode = flexSelectionByRow
flxItems.RowHeightMin = imgItems(0).Height + _
ScaleY(2, vbPixels, vbTwips)
flxItems.ColWidth(0) = flxItems.RowHeightMin
flxItems.Width = flxItems.ColWidth(0) + flxItems.ColWidth(1) + 400
flxItems.Clear
For i = 1 To NUM_ROWS
flxItems.Row = i - 1
flxItems.Col = 0
Set flxItems.CellPicture = imgItems(CInt(Rnd * 5)).Picture
flxItems.TextMatrix(i - 1, 1) = "Item " & Format$(i - 1)
Next i
End Sub
Iouri Boutchkine
[email protected]
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
|