![]() | Type | Description | ||
| 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.
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