property Items.CellVAlignment ([Item as Variant], [ColIndex as Variant]) as VAlignmentEnum

Retrieves or sets a value that indicates how the cell's caption is vertically aligned.

TypeDescription
Item as Variant A long expression that indicates the item's handle.
ColIndex as Variant A long expression that indicates the cell's handle or the column's index, a string expression that indicates the column's caption or the column's key.
VAlignmentEnum A VAlignmentEnum expression that indicates the cell's vertically alignment.

The CellVAlignment property aligns vertically the cell. The CellVAligment property aligns the +/i sign if the item contains child items. The CellVAlignment property has effect if the item displays cells using multiple lines. Use the CellSingleLine property to wrap the cell's caption on multiple lines. Use the ItemHeight property to specify the height of the item. Use the <br> built-in HTML format to break a line, when CellCaptionFormat property is exHTML. Use the CellHAlignment property to align horizontally the cell. The +/- button is aligned accordingly to the cell's caption. Use the Def(exCellVAlignment) property to specify the same vertical alignment for the entire column.

The following VB sample aligns the focused cell to the bottom:

With ComboBox1.Items
    .CellVAlignment(.FocusItem, 0) = VAlignmentEnum.exBottom
End With

The following C++ sample right aligns the focused cell:

#include "Items.h"
CItems items = m_combobox.GetItems();
items.SetCellVAlignment( COleVariant( items.GetFocusItem() ), COleVariant( (long)0 ), 2 /*exBottom*/ );

The following VB.NET sample right aligns the focused cell:

With AxComboBox1.Items
    .CellVAlignment(.FocusItem, 0) = EXCOMBOBOXLib.VAlignmentEnum.exBottom
End With

The following C# sample right aligns the focused cell:

axComboBox1.Items.set_CellVAlignment(axComboBox1.Items.FocusItem, 0, EXCOMBOBOXLib.VAlignmentEnum.exBottom);

The following VFP sample right aligns the focused cell:

with thisform.ComboBox1.Items
	.DefaultItem = .FocusItem
	.CellVAlignment(0,0) = 2 && exBottom
endwith

Note: The intersection of an item with a column defines a cell. Each cell is uniquely represented by its handle. The cell's handle is of HCELL type, that's equivalent with a long type. All properties of Items object that have two parameters Item and ColIndex, refer a cell.

The following lines are equivalents and each of them changes the bold font attribute of the first cell on the first item.

With ComboBox1
    .Items.CellBold(, .Items.ItemCell(.Items(0), 0)) = True
    .Items.CellBold(.Items(0), 0) = True
    .Items.CellBold(.Items(0)) = True
    .Items.CellBold(.Items.ItemByIndex(0)) = True
    .Items.CellBold(.Items.ItemByIndex(0), 0) = True
    .Items.CellBold(.Items(0), ComboBox1.Columns(0).Caption) = True
End With