Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi StringGrid cellen Inhalt to Clipboard (https://www.delphipraxis.net/113697-stringgrid-cellen-inhalt-clipboard.html)

SaFu 13. Mai 2008 09:53


StringGrid cellen Inhalt to Clipboard
 
Mosche

kann mir jemand mal einen Ansatz geben wie ich eine makierte Zelle aus dem StrinGrid Kopieren und wieder in eine andere einfügen kann.

Gruß Sascha

DeddyH 13. Mai 2008 09:55

Re: StringGrid cellen Inhalt to Clipboard
 
Kannst Du den Text nicht einfach zuweisen?
Delphi-Quellcode:
StringGrid.Cells[1,1] := StringGrid.Cells[2,2];
Ungetestet, aber müsste doch gehen.

FAlter 13. Mai 2008 10:04

Re: StringGrid cellen Inhalt to Clipboard
 
Hi,

ich glaube, er meint die Zwischenablage.

IIRC:

Delphi-Quellcode:
uses
  Clipbrd;

Clipboard.AsText := StringGrid.Cells[1, 2];

StringGrid.Cells[2, 1] := Clipboard.AsText;
Ist jetzt aber nicht überprüft.

Mfg
FAlter

DeddyH 13. Mai 2008 10:07

Re: StringGrid cellen Inhalt to Clipboard
 
Aber wieso soll das unbedingt über das Clipboard gemacht werden, wenn es auch ohne geht?

SaFu 13. Mai 2008 10:08

Re: StringGrid cellen Inhalt to Clipboard
 
Hab es jetzt mal so versucht aber geht irgendwie nicht
Delphi-Quellcode:
  if (ssCtrl in Shift) and (Key = Ord('C')) then
  begin
    sKopieren:= StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];
  end;

   if (ssCtrl in Shift) and (Key = Ord('V')) then
  begin
     sEinfuegen:= StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];
  end;

DeddyH 13. Mai 2008 10:11

Re: StringGrid cellen Inhalt to Clipboard
 
Delphi-Quellcode:
if (ssCtrl in Shift) and (Key = Ord('C')) then
  begin
    sKopieren:= StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];
  end;

   if (ssCtrl in Shift) and (Key = Ord('V')) then
  begin
     StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row] := sKopieren;
  end;
Macht so in meinen Augen mehr Sinn.

Die Muhkuh 13. Mai 2008 10:12

Re: StringGrid cellen Inhalt to Clipboard
 
Sollte das nicht so aussehen:

Delphi-Quellcode:
if (ssCtrl in Shift) and (Key = Ord('C')) then
  begin
    sKopieren:= StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];
  end;

   if (ssCtrl in Shift) and (Key = Ord('V')) then
  begin
    StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row] := sKopieren;
  end;
[edit]Verdammt! Heute isser schnell der Junge[/edit]

DeddyH 13. Mai 2008 10:12

Re: StringGrid cellen Inhalt to Clipboard
 
Ha, schneller :tongue:

Die Muhkuh 13. Mai 2008 10:12

Re: StringGrid cellen Inhalt to Clipboard
 
Heute Powerfrühstück gehabt? :tongue:

SaFu 13. Mai 2008 10:15

Re: StringGrid cellen Inhalt to Clipboard
 
:wall:

Ja das macht mehr sinn und dann gehts auch danke


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:06 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz