property Items.LockedItem (Alignment as VAlignmentEnum, Index as Long) as HITEM
Retrieves the handle of the locked item. /*not supported in the lite version*/

TypeDescription
Alignment as VAlignmentEnum A VAlignmentEnum expression that indicates whether the locked item requested is on the top or bottom side of the control.
Index as Long A long expression that indicates the position of item being requested.
HITEM A long expression that indicates the handle of the locked item.
A locked or fixed item is always displayed on the top or bottom side of the control no matter if the control's list is scrolled up or down. A locked item is not selectable. Use the LockedItem property to access a locked item by its position. Use the LockedItemCount property to add or remove items fixed/locked to the top or bottom side of the control. Use the ShowLockedItems property to show or hide the locked items. Use the IsItemLocked property to check whether an item is locked or unlocked. Use the CellCaption property to specify the caption for a cell. Use the SelectableItem property to indicate whether the item is selectable.

The following VB sample adds an item that's locked to the top side of the control:

With ComboBox1
    Dim a As EXCOMBOBOXLibCtl.VAlignmentEnum
    a = EXCOMBOBOXLibCtl.VAlignmentEnum.exTop
    .BeginUpdate
    With .Items
        .LockedItemCount(a) = 1
        Dim h As EXCOMBOBOXLibCtl.HITEM
        h = .LockedItem(a, 0)
        .CellCaption(h, 0) = "<b>locked</b> item"
        .CellCaptionFormat(h, 0) = exHTML
    End With
    .EndUpdate
End With

The following C++ sample adds an item that's locked to the top side of the control:

#include "Items.h"
m_combobox.BeginUpdate();
CItems items = m_combobox.GetItems();
items.SetLockedItemCount( 0 /*exTop*/, 1);
long i = items.GetLockedItem( 0 /*exTop*/, 0 );
COleVariant vtItem(i), vtColumn( long(0) );
items.SetCellCaption( vtItem, vtColumn, COleVariant( "<b>locked</b> item" ) );
items.SetCellCaptionFormat( vtItem, vtColumn, 1/*exHTML*/ );
m_combobox.EndUpdate();

The following VB.NET sample adds an item that's locked to the top side of the control:

With AxComboBox1
    .BeginUpdate()
    With .Items
        .LockedItemCount(EXCOMBOBOXLib.VAlignmentEnum.exTop) = 1
        Dim i As Integer
        i = .LockedItem(EXCOMBOBOXLib.VAlignmentEnum.exTop, 0)
        .CellCaption(i, 0) = "<b>locked</b> item"
        .CellCaptionFormat(i, 0) = EXCOMBOBOXLib.CaptionFormatEnum.exHTML
    End With
    .EndUpdate()
End With

The following C# sample adds an item that's locked to the top side of the control:

axComboBox1.BeginUpdate();
EXCOMBOBOXLib.Items items = axComboBox1.Items;
items.set_LockedItemCount(EXCOMBOBOXLib.VAlignmentEnum.exTop, 1);
int i = items.get_LockedItem(EXCOMBOBOXLib.VAlignmentEnum.exTop, 0);
items.set_CellCaption(i, 0, "<b>locked</b> item");
items.set_CellCaptionFormat(i, 0, EXCOMBOBOXLib.CaptionFormatEnum.exHTML);
axComboBox1.EndUpdate();

The following VFP sample adds an item that's locked to the top side of the control:

with thisform.ComboBox1
	.BeginUpdate()
		With .Items
			.LockedItemCount(0) = 1
			.DefaultItem = .LockedItem(0, 0)
			.CellCaption(0, 0) = "<b>locked</b> item"
			.CellCaptionFormat(0, 0) = 1 && EXCOMBOBOXLib.CaptionFormatEnum.exHTML
		EndWith
	.EndUpdate()
endwith