Handling User Toolbox Selections

When the user double-clicks an item in the toolbox, the host calls the designer's IDesignerToolbox::ItemPicked method, passing an IDataObject pointer to the item. The designer checks the data object to determine which item was selected, responds in a manner appropriate to the selected item, calls the host's IDesignerToolboxSite::OnItemPicked method, and then returns S_OK.

For example, if the user picks a drawing tool, the designer might have to initialize the drawing tool and change the cursor. When the designer calls OnItemPicked, the host can respond by redrawing the toolbox to highlight the selected item.

At any time, a designer can find out which item is currently selected by calling the host's IDesignerToolboxSite::GetData method. This method can return information about any ActiveX control or toolbox item the designer has added.