SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Returns the defined image type.
Get
VB.NET | Style = object.Type As SftPictureTypeConstants |
VB | Style = object.Type As SftPictureTypeConstants |
C#.NET | SftPictureTypeConstants Style = object.Type; |
VC++ | enum SftPictureTypeConstants Style = object->Type; enum SftPictureTypeConstants Style = object->GetType(); |
C | HRESULT object->get_Type(enum SftPictureTypeConstants* Style); |
object
A SftPictureObject object.
Style
Returns the defined image type.
Name | Value | Description |
---|---|---|
sftTypeNone | 0 | None - The SftPictureObject is empty. |
sftTypeIDispatch | 1 | IDispatch - Contains an OLE Picture object (supporting the IPicture or IPictureDisp interface). |
sftTypeBitmap | 2 | Bitmap - Contains a Windows bitmap. |
sftTypeIcon | 3 | Icon - Contains an icon. |
sftTypeImageList | 4 | ImageList - Contains an image from an ImageList control. |
sftTypeColorSample | 5 | Color Sample - Contains a color sample. |
sftTypeBuiltin | 6 | Built-In Appearance - Contains a predefined built-in image. |
sftTypeImageListH | 7 | ImageListH - Contains an image from an ImageList control. |
sftTypeGDIPlus | 8 | GDIPlus - Contains a GDI+ image |
The Type property returns the defined image type.
The Type property reflects the type of the current image. It is modified by assigning an image to the SftPictureObject using a property such as SftPictureObject.Appearance, SftPictureObject.BitmapHandle, SftPictureObject.IconHandle, SftPictureObject.SetColorSample, etc.
' cell text Dim Data As System.Windows.Forms.DataObject Data = New System.Windows.Forms.DataObject() Data.SetData(DataFormats.Text, AxSftTree1.get_Cell(curr, 0).Text) ' item picture Dim img As SftPictureObject If AxSftTree1.get_Item(curr).Image.Type = SftPictureTypeConstants.sftTypeIDispatch Then img = AxSftTree1.get_Item(curr).Image Else If AxSftTree1.get_Item(curr).Expanded Then img = AxSftTree1.Items.ItemImageExpanded ElseIf AxSftTree1.get_Item(curr).DependentAllCount > 0 Then img = AxSftTree1.Items.ItemImageExpandable Else img = AxSftTree1.Items.ItemImageLeaf
Private Sub SftTree1_OLEStartDrag(Data As SftTreeLib75.DataObject, AllowedEffects As Long) Dim curr As Integer curr = SftTree1.Items.Current ' cell text Data.SetData SftTree1.Cell(curr, 0).Text, vbCFText ' item picture If SftTree1.Item(curr).Image.Type = sftTypeIDispatch Then Data.SetData SftTree1.Item(curr).Image.Picture, vbCFDIB Else If SftTree1.Item(curr).Expanded Then Data.SetData SftTree1.Items.ItemImageExpanded.Picture, vbCFDIB ElseIf SftTree1.Item(curr).DependentAllCount > 0 Then Data.SetData SftTree1.Items.ItemImageExpandable.Picture, vbCFDIB Else Data.SetData SftTree1.Items.ItemImageLeaf.Picture, vbCFDIB End If
int curr = axSftTree1.Items.Current; // cell text System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject(); data.SetData(DataFormats.Text, axSftTree1.get_Cell(curr, 0).Text); // item picture SftPictureObject img = null; if (axSftTree1.get_Item(curr).Image.Type == SftPictureTypeConstants.sftTypeIDispatch) { img = axSftTree1.get_Item(curr).Image; } else { if (axSftTree1.get_Item(curr).Expanded) img = axSftTree1.Items.ItemImageExpanded; else if (axSftTree1.get_Item(curr).DependentAllCount > 0) img = axSftTree1.Items.ItemImageExpandable; else img = axSftTree1.Items.ItemImageLeaf;
{ IVDMDataObjectPtr pDataObject = *Data; ASSERT(pDataObject != NULL); long curr = m_vTree->Items->Current; // cell text pDataObject->SetData(_variant_t(m_vTree->Cell[curr][0]->Text), _variant_t((short)sftCFText)); // item picture if (m_vTree->Item[curr]->Image->Type == sftTypeIDispatch) { pDataObject->SetData(_variant_t(m_vTree->Item[curr]->Image->GetPicture(), _variant_t((short)sftCFDIB))); } else { if (m_vTree->Item[curr]->Expanded != VARIANT_FALSE) pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpanded->GetPicture(), _variant_t((short)sftCFDIB))); else if (m_vTree->Item[curr]->DependentAllCount > 0) pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpandable->GetPicture(), _variant_t((short)sftCFDIB))); else
See Also SftPictureObject Object | Object Hierarchy