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 the Groups collection.

Use the AddGroup event to notify your application that a new group was added to Groups collection. The Add method adds a new group to Groups collection. Use the SelectItem property to get the index of the selected item. Use the SelectGroup property to get the index of the selected group. 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.EXLISTBARLib.Group Group)
{
}

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

Syntax for AddGroup event, /COM version, on:

private void AddGroup(object sender, AxEXLISTBARLib._IListBarEvents_AddGroupEvent e)
{
}

void OnAddGroup(LPDISPATCH Group)
{
}

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

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

procedure AddGroup(sender: System.Object; e: AxEXLISTBARLib._IListBarEvents_AddGroupEvent);
begin
end;

begin event AddGroup(oleobject Group)
end event AddGroup

Private Sub AddGroup(ByVal sender As System.Object, ByVal e As AxEXLISTBARLib._IListBarEvents_AddGroupEvent) Handles AddGroup
End Sub

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

Private Sub AddGroup(ByVal Group As Object)
End Sub

LPARAMETERS Group

PROCEDURE OnAddGroup(oListBar,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.ListBar.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 ListBar1_AddGroup(ByVal Group As EXLISTBARLibCtl.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 OnAddGroupListbar1(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 AxListBar1_AddGroup(ByVal sender As Object, ByVal e As AxEXLISTBARLib._IListBarEvents_AddGroupEvent) Handles AxListBar1.AddGroup
    With e.group
        .BackColor = ToUInt32(Color.Blue)
        .ForeColor = ToUInt32(Color.White)
        .Alignment = EXLISTBARLib.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 axListBar1_AddGroup(object sender, AxEXLISTBARLib._IListBarEvents_AddGroupEvent e)
{
	e.group.BackColor = ToUInt32(Color.Blue);
	e.group.ForeColor = ToUInt32(Color.White);
	e.group.Alignment = EXLISTBARLib.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