Rob,

A while back I derived a DBGrid class that has the MouseDown()
function overridden like this:


(***************************

  TDBGridClick = class(TCustomDBGrid)
  protected
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
      X, Y: Integer); override;
  public
    property Canvas;
  published
    property Align;
    property BorderStyle;
        //  ...
        //  all the usual properties - snipped here for brevity
        //  ...
    property OnKeyPress;
    property OnKeyUp;
  end;

implementation


procedure TDBGridClick.MouseDown(Button: TMouseButton;
           Shift: TShiftState;  X, Y: Integer);
var
  Cell: TGridCoord;
begin
  try
    if ( Button = mbLeft ) and
                  (datasource.dataset.recordcount > 0 )
    then BeginDrag(false,5);
  except
  end;
  inherited MouseDown( Button, Shift, x, y );
end;

***************************)


But I'm going to take a look at Stacey's suggestion (posted earlier
on this thread) to see if I really need this any more.

Hope one at least one of these solves your problem

-ns


-----Original Message-----
From: Robert Martin <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Thursday, November 23, 2000 03:24
Subject: [DUG]: Drag and Drop


Hi

Im trying to implement drag and drop between a TDBGrid and a TTreeView.  The
Treeview works great but the dmAutomatic in the TDBGrid is hopeless.  It
starts dragging straight away and doesnt allow the user to select an item.
I have tried maually performing the operation (BeginDrag etc) but I believe
I require the OnMouseDown event which is not visible in the TDBGrid.

Is there a better (simple) way of doing this.  Am I missing somthing?


Rob
Software engineer
Wild Software Ltd
[EMAIL PROTECTED]


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to