Add images to oImageList

Add images to oImageList

Postby Natter » 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 ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Add images to oImageList

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Add images to oImageList

Postby Natter » Wed Feb 14, 2018 12:57 pm

Thank You, Antonio ! Work normally
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests