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 current processing 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 current processing modes.
Applications may wish to respond to events such as 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 control has to be cleared. This can be accomplished using the CancelMode method.
End Sub Private Sub AxSftButton1_DropDownClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton1.DropDownClick ' The drop down button was clicked. Display a popup menu ' right-aligned with the right edge of the button Dim pt As Point = New Point(AxSftButton1.Location.X + AxSftButton1.Size.Width, _ AxSftButton1.Location.Y + AxSftButton1.Size.Height) pt = PointToScreen(pt) AxSftButton1.CancelMode() TrackPopupMenu(ContextMenu1.Handle, Convert.ToUInt32(TPM_RIGHTALIGN Or TPM_TOPALIGN Or TPM_LEFTBUTTON), pt.X, pt.Y, 0, Me.Handle, IntPtr.Zero) End Sub Private Sub AxSftButton2_DropDownClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton2.DropDownClick ' The drop down button was clicked. Display a popup menu ' right-aligned with the right edge of the button Dim pt As Point = New Point(AxSftButton2.Location.X + AxSftButton2.Size.Width, _
private void axSftButton1_DropDownClick(object sender, System.EventArgs e) { // The drop down button was clicked. Display a popup menu // right-aligned with the right edge of the button Point pt = new Point(axSftButton1.Location.X + axSftButton1.Size.Width, axSftButton1.Location.Y + axSftButton1.Size.Height); pt = PointToScreen(pt); axSftButton1.CancelMode(); TrackPopupMenu(contextMenu1.Handle, TPM_RIGHTALIGN|TPM_TOPALIGN|TPM_LEFTBUTTON, pt.X, pt.Y, 0, this.Handle, IntPtr.Zero); } private void axSftButton2_ClickEvent(object sender, System.EventArgs e) { // Invoke the default action, because the button was clicked menuItem1_Click(axSftButton2, new System.EventArgs()); }
See Also SftButton Object | Object Hierarchy