View Full Version : MSFlexGrid picture
Micheltje
12-07-2002, 06:03 AM
I've read this text on one of the topics:
Remarks
You can put text, a picture, or both, in any cell of an MSFlexGrid. The Row and Col properties specify the current cell in an MSFlexGrid. You can specify the current cell in code, or the user can change it at run time using the mouse or the arrow keys. The Text property references the contents of the current cell.
and my question is , i've try'd to add pictures to a cell (0,1) but it didn't work, the only thing i saw was an error , can someone help me?
Flyguy
12-07-2002, 06:15 AM
Can you show us your code and tell us the error number/description you get.
Micheltje
12-07-2002, 06:27 AM
When i've posted this topic my friend came online and i asked him if he knew the answer... this is what he said:
Set MSFlexgrid.CellPicture = imgImages.ListImages(1).Picture
Dim img As ListImage
Set img = imgImages.ListImages.Add(1, "Ticked", LoadPicture(App.Path & "\TickedBox.Bmp"))
Set img = imgImages.ListImages.Add(2, "Crossed", LoadPicture(App.Path & "\Crossed.Bmp"))
Set MSFlexgrid.CellPicture = imgImages.ListImages(1).Picture
But it didn't work either. my first code wasn't very diffucult .. but i try'd MsFlexGrid1.CellPicture (0,1) = app.Path & "Plaatjes/icon.ico"
Flyguy
12-07-2002, 06:37 AM
Indeed, the CellPicture method works only on the current cell (.Row, .Col), it doesn't accept parameters.
Micheltje
12-07-2002, 06:46 AM
Do you know how i can let it work? :)
Flyguy
12-07-2002, 07:49 AM
Straight from the help:
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
Micheltje
12-07-2002, 08:14 AM
If query!Type = "uitgaven" Then
MSFlexGrid1.Row = 1
MSFlexGrid1.Cols = 1
Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico")
End If
This is the code what i currently have. But it doesn'y work either.. i get this error:
<Invalid Column Value>
Flyguy
12-08-2002, 03:33 AM
How many rows & columns does your flexgrid have?
Originally posted by Micheltje
If query!Type = "uitgaven" Then
MSFlexGrid1.Row = 1
MSFlexGrid1.Cols = 1
Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico")
End If
This is the code what i currently have. But it doesn'y work either.. i get this error:
<Invalid Column Value>
Try this way.
If query!Type = "uitgaven" Then
MSFlexGrid1.Row = 1
MSFlexGrid1.Col = 1
Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico")
End If
Micheltje
12-08-2002, 05:54 AM
Thanks a lot :) .. it worked
Michel
Powered by: vBulletin v3.8.4