如果我将DragMode设置为dmAutomatic,它会阻止我选择行。如果我使用OnCellClick来调用BeginDrag,它只会在鼠标打开时触发,在我看来这不是拖拽。如果我使用OnMouseDown,它只在标题行触发。
我该怎么做呢?
发布于 2013-05-29 00:21:18
重载MouseDown将导致预期的结果。
type
TDBGrid=Class(DBGrids.TDBGrid)
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
End;
TForm2 = class(TForm)
.......
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
{ TDBGrid }
procedure TDBGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Begindrag(false);
inherited;
end;https://stackoverflow.com/questions/16796669
复制相似问题