Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftBoxCell.ImageHAlign Property

Defines the horizontal alignment of the graphic in this cell.

Syntax

Get

VB.NETStyle = object.ImageHAlign As SftBoxHAlignConstants
VBStyle = object.ImageHAlign As SftBoxHAlignConstants
C#.NETSftBoxHAlignConstants Style = object.ImageHAlign;
VC++enum SftBoxHAlignConstants Style = object->ImageHAlign;
enum SftBoxHAlignConstants Style = object->GetImageHAlign();
CHRESULT object->get_ImageHAlign(enum SftBoxHAlignConstants* Style);

Put

VB.NETobject.ImageHAlign = Style As SftBoxHAlignConstants
VBobject.ImageHAlign = Style As SftBoxHAlignConstants
C#.NETSftBoxHAlignConstants object.ImageHAlign = Style;
VC++enum SftBoxHAlignConstants object->ImageHAlign = Style;
void object->PutImageHAlign(enum SftBoxHAlignConstants Style);
CHRESULT object->put_ImageHAlign(enum SftBoxHAlignConstants Style);

object

A SftBoxCell object.

Style

Defines the horizontal alignment of the graphic in this cell.

NameValueDescription
halignSftBoxLeft0The graphic is to the left of the cell text.
halignSftBoxCenter1The graphic is centered in the cell.
halignSftBoxRight2The graphic is to the right of the cell text.

Comments

The ImageHAlign property defines the horizontal alignment of the graphic in this cell.

The Cell.ImageVAlign property is used to define the vertical alignment of the graphic in this cell. The cell graphic is defined using the Cell.Image property.

Examples

VB.NET

        AxSftBox1.get_Item(ItemIndex).RowHeader.Image = Img
    End If
End Sub

Private Sub UpdateImages(ByVal ItemIndex As Integer, ByVal Img As Image, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    C = AxSftBox1.get_Cell(ItemIndex, 0)
    C.Image.NETImageObject = Img
    C.ImageHAlign = Align
    PropagateImage(ItemIndex, C.Image)
End Sub

Private Sub UpdateImageList(ByVal ItemIndex As Integer, ByVal ImageListControl As ImageList, ByVal i As Integer, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    C = AxSftBox1.get_Cell(ItemIndex, 0)
    C.Image.SetImageListH(ImageListControl.Handle.ToInt32(), i)

VB6

        SftBox1.Item(ItemIndex).RowHeader.Image = Img
    End If
End Sub

Private Sub UpdatePictures(ByVal ItemIndex As Integer, ByVal Pic As StdPicture, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    Set C = SftBox1.Cell(ItemIndex, 0)
    Set C.Image.Picture = Pic
    C.ImageHAlign = Align
    PropagateImage ItemIndex, C.Image
End Sub

Private Sub UpdateImages(ByVal ItemIndex As Integer, ByVal Pic As LONG_PTR, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    Set C = SftBox1.Cell(ItemIndex, 0)
    C.Image.SetImage Pic, True

C#

        axSftBox1.get_Item(ItemIndex).RowHeader.Image = Img;
    }
}

private void UpdateImages(int ItemIndex, System.Drawing.Image img, SftBoxHAlignConstants Align)
{
    SftBoxCell C = axSftBox1.get_Cell(ItemIndex, 0);
    C.Image.NETImageObject = img;
    C.ImageHAlign = Align;
    PropagateImage(ItemIndex, C.Image);
}

private void UpdateImageList(int ItemIndex, ImageList ImageListControl, int i, SftBoxHAlignConstants Align)
{
    SftBoxCell C = axSftBox1.get_Cell(ItemIndex, 0);
    C.Image.SetImageListH((int) ImageListControl.Handle, (short) i);

C++

        m_vBox->Item[ItemIndex]->RowHeader->Image = Img;
    }
}

void CPicturesDlg::UpdateBitmap(long ItemIndex, const CBitmap& bmp, SftBoxHAlignConstants Align)
{
    ISftBoxCellPtr C = m_vBox->Cell[ItemIndex][0];
    C->Image->PutBitmapHandle((OLE_HANDLE)(HBITMAP) bmp);
    C->ImageHAlign = Align;
    PropagateImage(ItemIndex, C->Image);
}

void CPicturesDlg::UpdateImage(long ItemIndex, int resourceID, SftBoxHAlignConstants Align)
{
    ISftBoxCellPtr C = m_vBox->Cell[ItemIndex][0];
    C->Image->raw_LoadImageFromResource((long) AfxGetApp()->m_hInstance, L"PNG", (LPWSTR)MAKEINTRESOURCE(resourceID));

See Also SftBoxCell Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.