IUICollection interface (Windows)

Switch View :
ScriptFree
IUICollection interface

Applies to: desktop apps only

The IUICollection interface is implemented by the Ribbon framework. The IUICollection interface defines the methods for dynamically manipulating collection-based controls, such as the various Ribbon galleries and the Quick Access Toolbar (QAT), at run time.

Members

The IUICollection interface inherits from the IUnknown interface. IUICollection also has these types of members:

Methods

The IUICollection interface has these methods.

MethodDescription
Add

Adds an item to the end of the IUICollection.

Clear

Deletes all items from the IUICollection.

GetCount

Retrieves the number of items contained in the IUICollection.

GetItem

Retrieves an item from the IUICollection at the specified index.

Insert

Inserts an item into the IUICollection at the specified index.

RemoveAt

Removes an item from the IUICollection at the specified index.

Replace

Replaces an item at the specified index of the IUICollection with another item.

 

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008

Header

Uiribbon.h

IDL

Uiribbon.idl

DLL

Uiribbon.dll

See also

IUICollectionChangedEvent
Gallery Sample

 

 

Send comments about this topic to Microsoft

Build date: 2/15/2012

Community Content

Arik Poznanski
C# Syntax
// Windows Ribbon Collection interface
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("DF4F45BF-6F9D-4dd7-9D68-D8F9CD18C4DB")]
public interface IUICollection
{
// Retrieves the count of the collection
[PreserveSig]
HRESULT GetCount(out UInt32 count);

// Retrieves an item
[PreserveSig]
HRESULT GetItem(UInt32 index, [Out(), MarshalAs(UnmanagedType.Interface)] out object item)

// Adds an item to the end
[PreserveSig]
HRESULT Add([MarshalAs(UnmanagedType.Interface)] object item);

// Inserts an item
[PreserveSig]
HRESULT Insert(UInt32 index, [MarshalAs(UnmanagedType.Interface)] object item)

// Removes an item at the specified position
[PreserveSig]
HRESULT RemoveAt(UInt32 index);

// Replaces an item at the specified position
[PreserveSig]
HRESULT Replace(UInt32 indexReplaced, [MarshalAs(UnmanagedType.Interface)] object itemReplaceWith);

// Clear the collection
[PreserveSig]
HRESULT Clear();
}