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
Cancels internal modes.
VB.NET | object.CancelMode() |
VB | object.CancelMode |
C#.NET | void object.CancelMode(); |
VC++ | HRESULT object->CancelMode(); |
C | HRESULT object->raw_CancelMode(); |
object
The CancelMode method cancels internal modes.
Applications may wish to respond to events such as ItemClick or MouseDown. Many mouse related events may have built-in functions, particularly drag & drop operations may be started after these events are processed. If an application wants to suppress the built-in behavior, e.g. to display a context menu, the internal state of the tree control has to be cleared. This can be accomplished using the CancelMode method.
End If ' determine item right-clicked Dim ItemIndex As Integer ItemIndex = AxSftTree1.Items.HitTestPix(e.x, e.y) If ItemIndex >= 0 And ItemIndex < AxSftTree1.Items.Count Then AxSftTree1.Items.Current = ItemIndex AxSftTree1.get_Item(ItemIndex).Selected = True AxSftTree1.CancelMode() ItemContextMenu.Show(Me, PointToClient(P)) End If End Sub Private Sub menuHeader_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim mItem As MenuItem mItem = sender
Else MenuForm.ShowContents.Enabled = True MenuForm.ShowDescription.Enabled = True MenuForm.ShowSize.Enabled = True End If MenuForm.ShowAll.Enabled = Count < 3 SftTree1.CancelMode PopupMenu MenuForm.HeaderPopup End Sub Private Sub SftTree1_ContextMenu(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) ' Determine click context menu for header or item Dim l As Single, t As Single, h As Single, w As Single
return; } // determine item right-clicked int ItemIndex = axSftTree1.Items.HitTestPix(e.x, e.y); if (ItemIndex >= 0 && ItemIndex < axSftTree1.Items.Count) { axSftTree1.Items.Current = ItemIndex; axSftTree1.get_Item(ItemIndex).Selected = true; axSftTree1.CancelMode(); ItemContextMenu.Show(this, PointToClient(point)); } } private void menuHeader_Click(object sender, System.EventArgs e) { MenuItem mItem = (MenuItem) sender; short colIndex = (short) mItem.Index;
m_HeaderMenu.AppendMenu(MF_SEPARATOR); m_HeaderMenu.AppendMenu(MF_STRING, HEADERMENU_SHOWALL, _T("&Show All")); if (count < m_vTree->ColumnsObj->Count) m_HeaderMenu.EnableMenuItem(HEADERMENU_SHOWALL, MF_ENABLED|MF_BYCOMMAND); else m_HeaderMenu.EnableMenuItem(HEADERMENU_SHOWALL, MF_DISABLED|MF_GRAYED|MF_BYCOMMAND); m_vTree->CancelMode(); m_HeaderMenu.TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, this); } void CBookTableDlg::ItemMenu(CPoint pt) { m_ItemMenu.DestroyMenu();
See Also SftTree Object | Object Hierarchy