FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Add images to oImageList
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Add images to oImageList
Posted: Wed Feb 14, 2018 10:02 AM

Hi, all !

There is a TTreeview object. It contains a set of files of different types. I need to add icons associated with the file type to ::oImageList. I do this:
img=BmpFromIcon( EXTRACTASSICON (0, MyFile, @sol)) - handle bitmap
TTreeview: oImageList:Add(img, NIL)

But get the error: Class 'NUMERIC' has no exported method 'HBITMAP'

What I am wrong ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Add images to oImageList
Posted: Wed Feb 14, 2018 10:50 AM

Class TImageList Method Add() expects a Class TBitmap object and not a bitmap handle

Try it this way:

TTreeview: oImageList:Add( TBitmap():Define( ,, oWnd, img ), oWnd )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Add images to oImageList
Posted: Wed Feb 14, 2018 12:57 PM

Thank You, Antonio ! Work normally

Continue the discussion