Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ImageHAlign Property, SftTreeCell Object

Defines the horizontal alignment of the graphic in this cell.

Syntax

Get

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

Put

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

object

A SftTreeCell object.

Style

Defines the horizontal alignment of the graphic in this cell.

NameValueDescription
halignSftTreeLeft0The graphic is on the left of the cell text.
halignSftTreeCenter1The graphic is centered in the cell.
halignSftTreeRight2The graphic is on 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

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

    Private Sub UpdatePictures(ByVal ItemIndex As Integer, ByVal IPic As stdole.IPictureDisp, ByVal Align As SftTreeHAlignConstants)
        Dim C As SftTreeCell
        C = AxSftTree1.get_Cell(ItemIndex, 0)
        C.Image.Picture = IPic
        C.ImageHAlign = Align
        PropagateImage(ItemIndex, C.Image)
    End Sub

    Private Sub UpdateImages(ByVal ItemIndex As Integer, ByVal Img As Image, ByVal Align As SftTreeHAlignConstants)
        Dim C As SftTreeCell
        C = AxSftTree1.get_Cell(ItemIndex, 0)
        C.Image.NETImageObject = Img

VB6

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

Private Sub UpdatePictures(ByVal ItemIndex As Integer, ByVal Pic As StdPicture, ByVal Align As SftTreeHAlignConstants)
    Dim C As SftTreeCell
    Set C = SftTree1.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 SftTreeHAlignConstants)
    Dim C As SftTreeCell
    Set C = SftTree1.Cell(ItemIndex, 0)
    C.Image.SetImage Pic, True

C#

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

        private void UpdatePictures(int ItemIndex, stdole.IPictureDisp IPic, SftTreeHAlignConstants Align)
        {
            SftTreeCell C = axSftTree1.get_Cell(ItemIndex, 0);
            C.Image.Picture = IPic;
            C.ImageHAlign = Align;
            PropagateImage(ItemIndex, C.Image);
        }

        private void UpdateImages(int ItemIndex, Image img, SftTreeHAlignConstants Align)
        {
            SftTreeCell C = axSftTree1.get_Cell(ItemIndex, 0);
            C.Image.NETImageObject = img;

C++

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

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

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

See Also SftTreeCell Object | Object Hierarchy


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


Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.