M
Mark Smith
My addin places a tool bar with a button on each inspector window. As per
previous advice I am using the Item Close event rather than the Inspector
Close event to delete my toolbar wrapper (ToolBar).
If the user uses the previous and next buttons, the Item close event fires
and the ToolBar attached to the inspector gets deleted. Then a New
Inspector event fires and a new ToolBar item is created and attached. On
the other hand, If the user deletes the item, the Item Close event fires,
but no New Inspector event fires. Thus the tool bar gets orphaned and no
longer functions.
So I tried to use the Inspector Close event instead of the Item Close event.
This allows the button to continue functioning after the user deletes an
item. Unfortunately this leaves extra ToolBars around that aren't needed.
In and of itself, this is not a big deal. The problem is that if the user
has used the previous or next buttons or deleted items, when the button is
clicked, the button handler fires for each ToolBar, resulting in the same
operation occuring on that item many times.
I have considered doing something with the tag name to make sure that a
pressing a given button only results in one action, but this seems like a
less than optimal solution. Other than that I can't think of anything. If
there is a better way, I would love to hear it. Any ideas?
Thank you,
Mark Smith
previous advice I am using the Item Close event rather than the Inspector
Close event to delete my toolbar wrapper (ToolBar).
If the user uses the previous and next buttons, the Item close event fires
and the ToolBar attached to the inspector gets deleted. Then a New
Inspector event fires and a new ToolBar item is created and attached. On
the other hand, If the user deletes the item, the Item Close event fires,
but no New Inspector event fires. Thus the tool bar gets orphaned and no
longer functions.
So I tried to use the Inspector Close event instead of the Item Close event.
This allows the button to continue functioning after the user deletes an
item. Unfortunately this leaves extra ToolBars around that aren't needed.
In and of itself, this is not a big deal. The problem is that if the user
has used the previous or next buttons or deleted items, when the button is
clicked, the button handler fires for each ToolBar, resulting in the same
operation occuring on that item many times.
I have considered doing something with the tag name to make sure that a
pressing a given button only results in one action, but this seems like a
less than optimal solution. Other than that I can't think of anything. If
there is a better way, I would love to hear it. Any ideas?
Thank you,
Mark Smith