Einzelnen Beitrag anzeigen

Flips

Registriert seit: 17. Feb 2005
Ort: Sankt Wendel
491 Beiträge
 
Delphi 7 Professional
 
#6

Re: Zellwert aus TStringGrid mit DragDrop in ein TEdit -Wie?

  Alt 14. Sep 2007, 12:58
Delphi-Quellcode:
procedure TForm3.StringGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  var acol,arow:integer;
begin
if Button = mbLeft then
  StringGrid1.MouseToCell(X,Y,acol,arow);
if (ACol <> -1) and (ARow <> -1) then
  Stringgrid1.BeginDrag(True);
end;

procedure TForm3.StringGrid2DragDrop(Sender, Source: TObject; X, Y: Integer);
var
  aCol, aRow : integer;
begin
(Sender as TStringGrid).MouseToCell(X,Y,aCol,ARow);
(Sender as TStringGrid).Cells[2,ARow] := (Source as TStringGrid).Cells[3,(Source as TStringGrid).Row];
end;

procedure TForm3.StringGrid2DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
Accept := (Source is TStringGrid);
end;
Philipp F.
  Mit Zitat antworten Zitat