Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to initialize imagelist use for listview?
Message
From
18/05/2001 04:55:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/05/2001 02:54:32
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00508596
Message ID:
00508609
Views:
18
>Hi,
> I am using a listview, and i wish to add picture(small icon) into the listview by using imagelist, but when run it, error message shown imagelist haven't initialize.
> How to solve this problem ?
> Why need to initialise imagelist ? but in vb is ok.
>
>kengwen

Chang,
Do you mean to initialize in code or on form ?
On form :
-Rightclick on imagelist
-Select Imagelist properties
-Set size
-Insert images

In code :
Define CLASS myForm AS form
*....
  Add OBJECT oleimageslist AS olecontrol WITH ;
    Top = 0, ;
    Left = 0, ;
    Height = 100, ;
    Width = 100, ;
    Name = "oleImagesList",;
    OleClass = 'MSComCtlLib.ImageListCtrl'

With this.oleimageslist
    .ImageHeight = 16
    .ImageWidth = 16
    .ListImages.Add(,"OpenFolder",LoadPicture(lcIconPath+"\openfold.ico"))
    .ListImages.Add(,"ClosedFolder",LoadPicture(lcIconPath+"\clsdfold.ico"))
    .ListImages.Add(,"Drive",LoadPicture(lcIconPath+"\drive.ico"))
    .ListImages.Add(,"Floppy",LoadPicture(lcIconPath+"\35floppy.ico"))
    .ListImages.Add(,"NetDrive",LoadPicture(lcIconPath+"\drivenet.ico"))
    .ListImages.Add(,"CDDrive",LoadPicture(lcIconPath+"\CDdrive.ico"))
Endwith
*...
If you mean assigning Imagelist to ListView - Treeview :
myOleView.imagelist = this.oleimageslist.object

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform