Home » Developer & Programmer » Forms » Help with ImageList and Treeview in comctl32.ocx (Forms 6i
Help with ImageList and Treeview in comctl32.ocx [message #387539] Thu, 19 February 2009 16:13 Go to next message
Messages: 1
Registered: February 2009
Location: Costa Rica
Junior Member
I Need to implement Microsoft Tree View (comctl32.ocx) in a form, i follow up an example that i found in this forum but the example doesn't show how to implement the images in the tree, Anybody know how to do this?. I already create a new object with Microsoft Image List (comctl32.ocx) but i don't know how to use the procedures and functions of the library and how to add images to the Image List.

Now the form is getting me this error "TypeMismatch - Code 13".

The code im using to initialize the Image list is this:

   ListImage        Oleobj;  
   Images           ComctlLib_Constants.IImages;
   Image            ComctlLib_Constants.IImage; 
   errCode          pls_integer;
   errSrc           varchar2(200);
   errDescription   varchar2(2000);
   errHelpfile      varchar2(200);
   errHelpContext   pls_integer;  
   ListImage := :item('LIST.IMAGE_LIST').interface; 
   Images := COMCTL_IImageList10.ListImages(ListImage);	 
   Image := COMCTL_IImages.Ole_Add (interface    => Images,
		                    zIndex       => to_variant ('1'),
		                    Key          => to_variant ('Pr1'),
		                    Picture      => to_variant ('C:\*****.jpg'));   
   When Form_Ole_Failure then 
      ErrCode := Last_Ole_Exception ( errSrc,
      Gen_Error ('Error: '||errSrc||': '||errDescription); 	  

Pd. Then i need to assing the images in the Image List to the nodes in the Tree View.

Re: Help with ImageList and Treeview in comctl32.ocx [message #388733 is a reply to message #387539] Thu, 26 February 2009 00:44 Go to previous messageGo to next message
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
What is the error number associated with the message "TypeMismatch - Code 13"?

Place 'message;pause;' pairs between each statement and tell us exactly which statement is causing the error.

Re: Help with ImageList and Treeview in comctl32.ocx [message #410596 is a reply to message #387539] Mon, 29 June 2009 03:47 Go to previous message
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

i already had the same problem let me tell how to solve it.

1.-where do you have your tree i dont see it.

2.- You dont need to add the images with code with right click in the image list object > properties and then you search the option for add the icons and then you will be able to add the images one by one selecting the filediectory and putting the key for each one. If you want diferent resolutions for your icons you have to add one image list for each resolution and use your imagination for swtitching from one to another.

3.- you are not telling to the tree that that image list belongs to the tree.

4.- Complete code how i did it:

x_tree oleobj;
x_imli oleobj;
x_nodes MSComctlLib_CONSTANTS.INodes;
x_node MSComctlLib_CONSTANTS.INode;


here you obtain the interface of a tree for your object

in this one you tell that you want the interface of the image list for attaching the images to the nodes

In this part you asign the image list to the tree


x_nodes:= MSComctlLib_ITreeView.Nodes(x_tree);


This is an example of one parent node
x_node := MSCOMCTLLIB_iNodes.ole_add(x_nodes, OleVar_empty, to_variant(1), to_variant('A1'), to_variant('Auftrag'),to_variant(3));<-- this is the variable for the image, in this one you tell to the tree that the image with the index # belongs the that node.

i hope that this can help you.

[Updated on: Mon, 29 June 2009 03:49]

Report message to a moderator

Previous Topic: its possible to call??????????????
Next Topic: Changing Color of a push button when mouse over
Goto Forum:

Current Time: Sat Jan 21 02:42:11 CST 2017

Total time taken to generate the page: 0.08018 seconds