Windows Develop Bookmark and Share   
 index > Windows Forms Designer > ComponentsCreated & ComponentsCreating events not firing from IToolboxService Drag & Drop
 

ComponentsCreated & ComponentsCreating events not firing from IToolboxService Drag & Drop

I have an app that uses DesignSurface to host a dashboard designer. I have the below code to catch the ComponentsCreated & ComponentsCreating events and they fire fine when a user draws the selected ToolboxItem on the design surface. But when the user tries to drag the ToolboxItem the event does not fire. Is thisa known issue? Does anybody know of a workaround?

Code Snippet

System.Drawing.Design.ToolboxItemCollection itemCollection = ((IToolboxService)toolbox).GetToolboxItems("PBIControls");

foreach (System.Drawing.Design.ToolboxItem toolItem in itemCollection)

{

toolItem.ComponentsCreated += new ToolboxComponentsCreatedEventHandler(OnControlAdded);

toolItem.ComponentsCreating += new ToolboxComponentsCreatingEventHandler(toolItem_ComponentsCreating);

}

Regards,

danielreber  Thursday, February 21, 2008 4:21 PM

This question has been asked multiple times in this newsgroup but nobody has answered it yet. Does anybody know if the events fire?

Regards,

danielreber  Friday, February 22, 2008 3:41 PM

You can use google to search for other answers

Custom Search

More Threads

• Abstract Base Class
• Simple System.Drawing or GDI+ question: I want to make my form's corners rounded
• Exposing UserControl collections at design time
• Comparing types of objects???
• Distance between controls
• Drawing rectangles on a picture box
• Treeview control
• Should the order controls are added matter?
• Designer - CodeDomDesignerLoader
• Copy paste problems