I maintain an old application who use vsFlexGrid. Grid is bound to a database and one field display 0 and 1 values. I try to replace this value with picture, so in AfterDataRefresh event i have this code:
... but grid display image and textvalue from database.Code:With grid .Redraw = flexRDNone For f = 1 To .Rows - 1 If .ValueMatrix(f, 2) = 0 Then .Cell(flexcpPicture, f, 2, f, 2) = imgHandleNOK Else .Cell(flexcpPicture, f, 2, f, 2) = imgHandleOK End If .Cell(flexcpPictureAlignment, f, 2, f, 2) = flexAlignCenterCenter Next f .Redraw = flexRDDirect End With
I can't usebecause image are stored in a ImageManager control from Codejock Activex and the control doesn't deliver the handle. I obtain one by one image using this code:Code:.ColImageList(2) = imgList.hImageList 'handle to an ImageList
...so can i display only image in column?Code:Dim imgHandleOK As StdPicture, imgHandleNOK As StdPicture Set imgHandleOK = ImageManager.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal) Set imgHandleNOK = ImageManager.Icons.GetImage(2, 16).CreatePicture(xtpImageNormal)




Reply With Quote