logo
VitNX3 Documentation

# DockContentDragFilter.PreFilterMessage Method

Namespace: VitNX.UI.ControlsV1.Win32
Assembly: VitNX3 (in VitNX3.dll)
Filters out a message before it is dispatched.
VB
C#
F#
C++
JScript
Copy

    public bool PreFilterMessage(
       ref Message m
    )

    This language is not supported or no code example is available.

#### Parameters

m
  Message

The message to be dispatched. You cannot modify this message.

#### Return Value

bool

true to filter the message and stop it from being dispatched; false to allow the message to continue to the next filter or control.

#### Implements

IMessageFilter.PreFilterMessage
Source code
VB
C#
F#
C++
JScript
Copy

    public bool PreFilterMessage(ref Message m)
     {
         if (!_isDragging)
             return false;
         if (!(m.Msg == (int)Enums.WINDOW_MESSAGE.MOUSE_MOVE ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.L_BUTTON_DOWN ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.L_BUTTON_UP ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.L_BUTTON_DBL_CLK ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.R_BUTTON_DOWN ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.R_BUTTON_UP ||
               m.Msg == (int)Enums.WINDOW_MESSAGE.R_BUTTON_DBL_CLK))
             return false;
         if (m.Msg == (int)Enums.WINDOW_MESSAGE.MOUSE_MOVE)
         {
             HandleDrag();
             return false;
         }
         if (m.Msg == (int)Enums.WINDOW_MESSAGE.L_BUTTON_UP)
         {
             if (_targetRegion != null)
             {
                 _dockPanel.RemoveContent(_dragContent);
                 _dragContent.DockArea = _targetRegion.DockArea;
                 _dockPanel.AddContent(_dragContent);
             }
             else if (_targetGroup != null)
             {
                 _dockPanel.RemoveContent(_dragContent);
                 switch (_insertType)
                 {
                     case DockInsertType.None:
                         _dockPanel.AddContent(_dragContent,
                             _targetGroup);
                         break;

                     case DockInsertType.Before:
                     case DockInsertType.After:
                         _dockPanel.InsertContent(_dragContent,
                             _targetGroup,
                             _insertType);
                         break;
                 }
             }
             StopDrag();
             return false;
         }
         return true;
     }

    This language is not supported or no code example is available.

Applies to

#### .NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

#### .NET Core

Supported in: 5.0+, 6.0+
See Also
DockContentDragFilter Class
VitNX.UI.ControlsV1.Win32 Namespace