首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从TDBGrid拖放?

如何从TDBGrid拖放?
EN

Stack Overflow用户
提问于 2013-05-29 00:06:55
回答 1查看 4.5K关注 0票数 1

如果我将DragMode设置为dmAutomatic,它会阻止我选择行。如果我使用OnCellClick来调用BeginDrag,它只会在鼠标打开时触发,在我看来这不是拖拽。如果我使用OnMouseDown,它只在标题行触发。

我该怎么做呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-29 00:21:18

重载MouseDown将导致预期的结果。

代码语言:javascript
复制
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;
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16796669

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档