Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftPictureObject.Width Property

Defines the desired image width.

Syntax

Get

VB.NETWPix = object.Width As Integer
VBWPix = object.Width As Long
C#.NETint WPix = object.Width;
VC++long WPix = object->Width;
long WPix = object->GetWidth();
CHRESULT object->get_Width(long* WPix);

Put

VB.NETobject.Width = WPix As Integer
VBobject.Width = WPix As Long
C#.NETint object.Width = WPix;
VC++long object->Width = WPix;
void object->PutWidth(long WPix);
CHRESULT object->put_Width(long WPix);

object

A SftPictureObject object.

WPix

Defines the desired image width.

Comments

The Width property defines the desired image width.

The desired image width is only used for built-in images (SftPictureObject.Type is sftTypeBuiltin) and color samples (SftPictureObject.Type is sftTypeColorSample). For all image types, the SftPictureObject.ActualHeight and SftPictureObject.ActualWidth properties reflect the image dimensions.

Examples

VB.NET

    C.ImageHAlign = Align
    PropagateImage(ItemIndex, C.Image)
End Sub

Private Sub UpdateColor(ByVal ItemIndex As Integer, ByVal Clr As System.Drawing.Color, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    C = AxSftBox1.get_Cell(ItemIndex, 0)
    C.Image.SetColorSample(OLECvt.ToOleColor(Clr), OLECvt.ToOleColor(Color.Black))
    C.Image.Width = 12
    C.Image.Height = 12
    C.ImageHAlign = Align
    PropagateImage(ItemIndex, C.Image)
End Sub

Private Sub AddColor(ByVal Text As String, ByVal Clr As Color)
    Dim i As Integer

VB6

    C.ImageHAlign = Align
    PropagateImage ItemIndex, C.Image
End Sub

Private Sub UpdateColor(ByVal ItemIndex As Integer, ByVal Clr As OLE_COLOR, ByVal Align As SftBoxHAlignConstants)
    Dim C As SftBoxCell
    Set C = SftBox1.Cell(ItemIndex, 0)
    C.Image.SetColorSample Clr, vbBlack
    C.Image.Width = 12
    C.Image.Height = 12
    C.ImageHAlign = Align
    PropagateImage ItemIndex, C.Image
End Sub

Private Sub AddColor(ByVal Text As String, ByVal Clr As OLE_COLOR)
    Dim I As Integer

C#

    C.ImageHAlign = Align;
    PropagateImage(ItemIndex, C.Image);
}

private void UpdateColor(int ItemIndex, System.Drawing.Color Clr, SftBoxHAlignConstants Align)
{
    SftBoxCell C = axSftBox1.get_Cell(ItemIndex, 0);
    C.Image.SetColorSample(OLECvt.ToOleColor(Clr), OLECvt.ToOleColor(Color.Black));
    C.Image.Width = 12;
    C.Image.Height = 12;
    C.ImageHAlign = Align;
    PropagateImage(ItemIndex, C.Image);
}

private void AddColor(string Text, Color Clr)
{

C++

    C->ImageHAlign = Align;
    PropagateImage(ItemIndex, C->Image);
}

void CPicturesDlg::UpdateColorSample(long ItemIndex, COLORREF Clr, SftBoxHAlignConstants Align)
{
    ISftBoxCellPtr C = m_vBox->Cell[ItemIndex][0];
    C->Image->SetColorSample(Clr, 0x80000000L|COLOR_WINDOWTEXT);
    C->Image->Width = 12;
    C->Image->Height = 12;
    C->ImageHAlign = Align;
    PropagateImage(ItemIndex, C->Image);
}

void CPicturesDlg::AddBuiltinImage(LPCTSTR lpszName, SftPictureImageConstants Appearance, long Width, long Height)
{

See Also SftPictureObject Object | Object Hierarchy


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