Hello world!
I have this TreeView created and I am trying to do some special with it. Instead of the typical "folder, document" icons I want to assign more icons to its elements, depending on the element type, specified in the element structure. For example, I want a folder icon for the root element, a book icon or a web page icon for its child and a document icon or image icon for the second level elements. If it is a book or a web page, a document or a image icon depends on a value that I send for each element of the TreeView control.
So, I have this function:
As you see, the level argument specifies what icon must be shown for the element. The bitmaps are created (I tested it) but only the root elements icons are shown. The first and second elements take the icon of last root element created. I feel like I don't understand the way of doing this. Little help please! Thanks!
Why does this happen to me? As soon as I post my question here I find the solution of my problem.
Obviously, my problem is that "type" is a bool and can only hold 0 and 1. The curious thing is that if I send an integer value to a Boolean argument I don't get an error. The values bigger than 1 are converted to zeros.