event AddGroup (Group as Group)
Occurs when a new group is added to collection.

TypeDescription
Group as Group A Group object that's added to Groups collection.

Use the AddGroup event to notify your application that a new group is added to Groups collection. The Add method adds a new group to Groups collection. Use the AddItem method to add new items to the group. Use the ItemHeight property to specify the height for all items in the group. Use the GroupHeight property to specify the height for group captions. Use the SmallIcons property to specify the size of the icons being displayed.

Syntax for AddGroup event, /NET version, on:

private void AddGroup(object sender,exontrol.EXPLORERBARLib.Group Group)
{
}

Private Sub AddGroup(ByVal sender As System.Object,ByVal Group As exontrol.EXPLORERBARLib.Group) Handles AddGroup
End Sub

Syntax for AddGroup event, /COM version, on:

private void AddGroup(object sender, AxEXPLORERBARLib._IExplorerBarEvents_AddGroupEvent e)
{
}

void OnAddGroup(LPDISPATCH Group)
{
}

void __fastcall AddGroup(TObject *Sender,Explorerbarlib_tlb::IGroup *Group)
{
}

procedure AddGroup(ASender: TObject; Group : IGroup);
begin
end;

procedure AddGroup(sender: System.Object; e: AxEXPLORERBARLib._IExplorerBarEvents_AddGroupEvent);
begin
end;

begin event AddGroup(oleobject Group)
end event AddGroup

Private Sub AddGroup(ByVal sender As System.Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_AddGroupEvent) Handles AddGroup
End Sub

Private Sub AddGroup(ByVal Group As EXPLORERBARLibCtl.IGroup)
End Sub

Private Sub AddGroup(ByVal Group As Object)
End Sub

LPARAMETERS Group

PROCEDURE OnAddGroup(oExplorerBar,Group)
RETURN

Syntax for AddGroup event, /COM version (others), on:

<SCRIPT EVENT="AddGroup(Group)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function AddGroup(Group)
End Function
</SCRIPT>

Procedure OnComAddGroup Variant llGroup
	Forward Send OnComAddGroup llGroup
End_Procedure

METHOD OCX_AddGroup(Group) CLASS MainDialog
RETURN NIL

void onEvent_AddGroup(COM _Group)
{
}

function AddGroup as v (Group as OLE::Exontrol.ExplorerBar.1::IGroup)
end function

function nativeObject_AddGroup(Group)
return

The following VB sample changes the group's background color when adding a new group:

Private Sub ExplorerBar1_AddGroup(ByVal Group As EXPLORERBARLibCtl.IGroup)
    With Group
        .BackColor = RGB(0, 0, 255)
        .Alignment = exRight
        .ForeColor = vbWhite
    End With
End Sub

The following C++ sample changes the group's background color when adding a new group:

void OnAddGroupExplorerbar1(LPDISPATCH Group) 
{
	CGroup group( Group ); group.m_bAutoRelease = FALSE;
	group.SetBackColor( RGB(0,0,255) );
	group.SetAlignment( 2 /*exRight*/ );
	group.SetForeColor( RGB(255,255,255) );
}

The following VB.NET sample changes the group's background color when adding a new group:

Private Sub AxExplorerBar1_AddGroup(ByVal sender As System.Object, ByVal e As AxEXPLORERBARLib._IExplorerBarEvents_AddGroupEvent) Handles AxExplorerBar1.AddGroup
    With e.group
        .BackColor = ToUInt32(Color.Blue)
        .ForeColor = ToUInt32(Color.White)
        .Alignment = EXPLORERBARLib.AlignmentEnum.exRight
    End With
End Sub

where the ToUInt32 function converts a Color expression to OLE_COLOR expression, 

Shared Function ToUInt32(ByVal c As Color) As UInt32
    Dim i As Long
    i = c.R
    i = i + 256 * c.G
    i = i + 256 * 256 * c.B
    ToUInt32 = Convert.ToUInt32(i)
End Function

The following C# sample changes the group's background color when adding a new group:

private void axExplorerBar1_AddGroup(object sender, AxEXPLORERBARLib._IExplorerBarEvents_AddGroupEvent e)
{
	e.group.BackColor = ToUInt32(Color.Blue);
	e.group.ForeColor = ToUInt32(Color.White);
	e.group.Alignment = EXPLORERBARLib.AlignmentEnum.exRight;
}

where the ToUInt32 function converts a Color expression to OLE_COLOR expression, 

private UInt32 ToUInt32(Color c)
{
	long i;
	i = c.R;
	i = i + 256 * c.G;
	i = i + 256 * 256 * c.B;
	return Convert.ToUInt32(i);
}

The following VFP sample changes the group's background color when adding a new group:

*** ActiveX Control Event ***
LPARAMETERS group

with group
	.BackColor = RGB(0,0,255)
	.ForeColor = RGB(255,255,255)
	.Alignment = 2 && exRight
endwith