TdxCustomDockControl.OnCanDocking Event
Enables you to control whether or not the dragged dock control can be docked to the current control.
Declaration
property OnCanDocking: TdxCanDockingEvent read; write;
Remarks
The OnCanDocking event fires repeatedly when dragging a dock control over the current control. The event’s Sender parameter identifies the current control (the target). The Source parameter is the control being dragged over. The Accept parameter specifies whether the current control should accept the control being dragged. Set this parameter to False to prohibit dropping.
The event provides three more parameter for greater control over docking operations. The Zone parameter identifies the target dock zone. You can read this zone’s settings to determine the docking type, for instance. The X and Y parameters specify the current mouse pointer coordinates. Note that these coordinates are set relative to the screen’s top-left corner.
Note
the OnCanDocking event is raised for the target control immediately after raising the OnDocking event for the source control. The Accept parameter’s initial value depends on whether the source control’s OnDocking event handler allows dropping. Thus, when handling the OnCanDocking event, you should first check the Accept parameter value. If the parameter is set to False, the source control doesn’t allow dropping, so you should not change this parameter value to avoid breaking the docking logic specified by the source control.