Hello
I'm trying to find the name of a shape by clicking on it.
I've succesfully created an event when the mouse pointer is on the shape by using the "SelectionChange" event, but how do I find the name of the shape I've just selected, so it's ready to place into a string variable.
The code I used to select the shape is shown below: -
procedure TMainForm.MappointSelectionChange(Sender: TObject; const pNewSelection, pOldSelection: IDispatch);
var
oShape: Shape;
begin
If assigned(pNewSelection) Then
Begin
pNewSelection.QueryInterface(IID_Shape, oShape);
If assigned(oShape) Then
Begin
Showmessage('Its a Shape');
// Now I need the name of the shape !!!!!!
End;
End;
end;
Note, I'm not using a commercial database, and have not imported data, I'm using my own comma delimited data to add the shapes.
Each shape has a name representing its place in the database. i.e. a number converted into a string.
I'm using Delphi but do understand VB (slightly), so any help in either language would be of great benefit.
Thank you
Regards
Les