Hi,
just wanted to let you know I have solved the first part of my problem. I use the LibraryBrowser with my custom shapes in it to both offer predefined objects and a drag/drop mechanism.
The second part I run into now is how to configure the shape that's been dropped. I can't seem to get a reference to the shape that ends up in the document.
I can get the dropped object of type NLibraryDataObject, find its first Masters object and get the first child from that NMaster. That gives me a shape object, of which I adjust the Text property.
However, the text property on the shape that is part of the document isn't updated.
What I want is to populate the tag and text and other properties of the shape that will be part of the document. I try to do it this way:
Dim l_objDroppedItem As Object = args.Data.GetData(args.Data.GetFormats()(0))
If TypeOf l_objDroppedItem Is NLibraryDataObject Then
Dim l_objLibraryObject As NLibraryDataObject = l_objDroppedItem
Dim l_objShape As NMaster = l_objLibraryObject.Masters(0)
DirectCast(l_objShape.GetChildAt(0), NShape).Text = InputBox("Transaction name:")
End If
Can you guide me in the right direction please? Thanks!