ActiveDatabaseSoftware.ActiveQueryBuilder Namespace > QueryBuilder Class : ControlDestroying Event |
'Declaration Public Event ControlDestroying As ControlDestroyingEventHandler
'Usage Dim instance As QueryBuilder Dim handler As ControlDestroyingEventHandler AddHandler instance.ControlDestroying, handler
public event ControlDestroyingEventHandler ControlDestroying
public: __event ControlDestroyingEventHandler* ControlDestroying
private void queryBuilder1_ControlDestroying(ControlOwner owner, Control control) { if (owner is DataSourceQuery && control is DataSourceControl) { DataSourceControl dataSourceControl = (DataSourceControl) control; foreach (Control c in dataSourceControl.Controls) { if (c is Button) { // remove event handler to avoid memory leak c.Click -= customButton_Click; break; } } } }