>I have one Treeview and one ImageList controls on my form.
>Using ImageList properties tab I added into it two pictures 32*32.
>My problem is that TreeView ActiveX control doesn't recognise my ImageList control.
>In Form.Init event I have following code
>
>Local Node
>Node=ThisForm.TreeView.Nodes.Add(,,"Subscriber","Sidorov","subs")
>Node.Expanded = .T.
>ThisForm.TreeView.Nodes.Add("Subscriber",4,"A","Petrov")
>ThisForm.TreeView.Nodes.Add("Subscriber",4,"B","Ivanov")
>ThisForm.TreeView.Nodes.Add("Subscriber",4,"C","Baranov")
>
>When I run the form I got an error: ImageList must be initialized before it can be used.
>
>Please help to solve the problem.
>
>Igor Gelin, System Developer
Try initializing the image object by adding an .ico or .bmp...
For example,
*- Initialize oImageList
WITH THISFORM
.oImageList.ListImages.Add(1, , loadpicture(sample.bmp))
ENDWITH
Then, to display the "sample.bmp" for a particular Node...
When you're adding a node to your tree control the last parameter would
be the image index assigned above { 1 }.
o.ADD(Parent, 4, Key, Desc, 1)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only