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
Edits the cell.
VB.NET | object.Edit(ByVal Window As Integer, ByVal vData As Object) |
VB | object.Edit(ByVal Window As OLE_HANDLE, ByVal vData As Variant) |
C#.NET | void object.Edit(int Window, object vData); |
VC++ | HRESULT object->Edit(OLE_HANDLE Window, const _variant_t& vData); |
C | HRESULT object->raw_Edit(OLE_HANDLE Window, VARIANT vData); |
object
A SftTreeCell object.
Window
A window handle. Defines the control used for cell editing. This parameter can be Nothing (NULL) to allow the EditInitializing event to provide the window handle used for cell editing (which is also the preferred method).
vData
An application-specific value. This value is used as vData parameter for the EditInitializing event. This parameter can be Nothing (NULL).
The Edit method edits the cell.
Cell editing is initiated by the subsequent EditInitializing event which is used to position and initialize the control used for cell editing.
The Edit method cannot edit a cell whose Cell.EditIgnore or Item.EditIgnore properties have marked the cell as non-editable or if the EditAllowed event indicates that the cell cannot be reached during cell editing.
End Sub Private Sub AxSftTree1_ItemClick(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemClickEvent) Handles AxSftTree1.ItemClick Dim Img As SftPictureObject Dim AreaType As SftTreeAreaTypeConstants AreaType = e.areaType If AreaType = SftTreeAreaTypeConstants.constSftTreeCellText Then ' User clicked on a cell AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0) ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeCellGraphic Then ' check if check box - toggle Img = AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Image If Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo Then Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes ElseIf Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes Then Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo
SftTree1.RowHeaders.MakeOptimal SftTree1.Items.RecalcHorizontalExtent End Sub Private Sub SftTree1_ItemClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer) If AreaType = constSftTreeCellText Then ' User clicked on a cell SftTree1.Cell(ItemIndex, ColIndex).Edit 0, 0 ElseIf AreaType = constSftTreeCellGraphic Then ' check if check box - toggle Dim Img As SftPictureObject Set Img = SftTree1.Cell(ItemIndex, ColIndex).Image If Img.Appearance = sftImageCheckboxNo Then Img.Appearance = sftImageCheckboxYes ElseIf Img.Appearance = sftImageCheckboxYes Then
axSftTree1.Items.RecalcHorizontalExtent(); } private void axSftTree1_ItemClick(object sender, AxSftTreeLib75._DSftTreeEvents_ItemClickEvent e) { SftPictureObject Img; SftTreeAreaTypeConstants area = (SftTreeAreaTypeConstants) e.areaType; if (area == SftTreeAreaTypeConstants.constSftTreeCellText) // User clicked on a cell axSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0); else if (area == SftTreeAreaTypeConstants.constSftTreeCellGraphic) { // check if check box - toggle Img = axSftTree1.get_Cell(e.itemIndex, e.colIndex).Image; if (Img.Appearance == SftPictureImageConstants.sftImageCheckboxNo) Img.Appearance = SftPictureImageConstants.sftImageCheckboxYes; else if (Img.Appearance == SftPictureImageConstants.sftImageCheckboxYes) Img.Appearance = SftPictureImageConstants.sftImageCheckboxNo;
HCURSOR CCellEditingDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } void CCellEditingDlg::OnItemClickSftTree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift) { if (AreaType == constSftTreeCellText) { m_vTree->Cell[ItemIndex][ColIndex]->Edit(NULL, _variant_t(0L)); } else if (AreaType == constSftTreeCellGraphic) { // check if check box - toggle ISftPictureObjectPtr pImg; pImg = m_vTree->Cell[ItemIndex][ColIndex]->Image; if (pImg->Appearance == sftImageCheckboxNo) pImg->Appearance = sftImageCheckboxYes; else if (pImg->Appearance == sftImageCheckboxYes)
See Also SftTreeCell Object | Object Hierarchy