I am new to VB.NET.
I have a simple Visio add-in that has a TreeView1 control on it. I am trying to display the image of the shapes in the nodes of the TreeView.
For this, I have ImageList1 control but I am really stuck in the following:
TreeView1.ImageList = ImageList1
TreeView1.ImageList.Images.Add(shp.NameID, shp.Picture) ' for Add(key As String, image As System.Drawing.Image) ' ERROR HERE
TreeView1.Nodes.Add(shp.NameID, shp.Name, shp.NameID) ' for Add(key As String, text As String, imageKey As String)
Ok, the type of shp.Picture is stdole.IPictureDisplay and the Add function of ImageList expects a parameter of type System.Drawing.Image but how to convert stdole.IPictureDisplay to System.Drawing.Image ? ? ?
I have used many codes posted on the internet without a success.
Does anybody knows how to do this. Please post the code (that really works please) rather than provide links to other sites.
I really would appreciate this help.