question about IComponentChangeService.ComponentAdding -
11-22-2007
, 04:52 AM
I have a query regarding cancelling the
IComponentChangeService.ComponentAdding event. I have an add-in that gets a
reference to the IDesignerHost windows, and then hooks into the
ComponentAdding event. Inside the ComponentAdding event I sometimes want to
be able to cancel the adding of a particular component. According to the
MSDN documentation "You can cancel the process of adding a component by
throwing an exception here". If I throw an exception inside this event
handler, although it does cancel the adding of the control, I get a
messagebox showing the exception message and OK button. I am wondering how
to cancel the adding of the control without poping up such a message?
thanks a lot :-) |