Active Query Builder 2 .NET Edition reference
ControlCreated Event
Example 



Invoked when a control is created inside the component.
Syntax
'Declaration
 
Public Event ControlCreated As ControlCreatedEventHandler
'Usage
 
Dim instance As QueryBuilder
Dim handler As ControlCreatedEventHandler
 
AddHandler instance.ControlCreated, handler
public event ControlCreatedEventHandler ControlCreated
public: __event ControlCreatedEventHandler* ControlCreated
Remarks

Use this event to customize internal controls and to add additional controls to the component.

The following combination of control and owner parameters are possible:

- owner is Query; control is TabPage (main query tab).
- owner is SubQuery; control is TabPage (sub-query tabs).
- owner is QueryColumnList; control is QueryColumnListControl.
- owner is DataSourceObject; control is DataSourceControl (database objects at Design Pane).
- owner is DataSourceQuery; control is DataSourceControl (sub-queries at Design Pane).
- owner is Link; control is LinkControl.
- owner is UnionSubQuery; control is UnionSubQueryPanel (you can get the link to DesignPane object here using the UnionSubQuery.DesignPane.GetControl method).
- owner is UnionSubQuery; control is UnionButton.
- owner is UnionSubQuery; control is UnionOperator.
- owner is UnionGroup; control is LeftBracket.
- owner is UnionGroup; control is RightBracket.
- owner is UnionGroup; control is UnionOperator.

Example
Adds button at the top of each sub-query DataSource control.
private void queryBuilder1_ControlCreated(ControlOwner owner, Control control)
{
    if (owner is DataSourceQuery && control is DataSourceControl)
    {
        DataSourceControl dataSourceControl = (DataSourceControl) control;
 
        // insert a small button above fields list
        Button customButton = new Button();
        customButton.Height = dataSourceControl.FieldList.ItemHeight;
        customButton.Dock = DockStyle.Top;
        customButton.Click += customButton_Click;
        dataSourceControl.Controls.Add(customButton);
    }
}
See Also

Reference

QueryBuilder Class
QueryBuilder Members
ControlDestroying Event

 

 


© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback