![]() |
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 |
Re: StringGrid cellen Inhalt to Clipboard
Kannst Du den Text nicht einfach zuweisen?
Delphi-Quellcode:
Ungetestet, aber müsste doch gehen.
StringGrid.Cells[1,1] := StringGrid.Cells[2,2];
|
Re: StringGrid cellen Inhalt to Clipboard
Hi,
ich glaube, er meint die Zwischenablage. IIRC:
Delphi-Quellcode:
Ist jetzt aber nicht überprüft.
uses
Clipbrd; Clipboard.AsText := StringGrid.Cells[1, 2]; StringGrid.Cells[2, 1] := Clipboard.AsText; Mfg FAlter |
Re: StringGrid cellen Inhalt to Clipboard
Aber wieso soll das unbedingt über das Clipboard gemacht werden, wenn es auch ohne geht?
|
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; |
Re: StringGrid cellen Inhalt to Clipboard
Delphi-Quellcode:
Macht so in meinen Augen mehr Sinn.
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; |
Re: StringGrid cellen Inhalt to Clipboard
Sollte das nicht so aussehen:
Delphi-Quellcode:
[edit]Verdammt! Heute isser schnell der Junge[/edit]
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; |
Re: StringGrid cellen Inhalt to Clipboard
Ha, schneller :tongue:
|
Re: StringGrid cellen Inhalt to Clipboard
Heute Powerfrühstück gehabt? :tongue:
|
Re: StringGrid cellen Inhalt to Clipboard
:wall:
Ja das macht mehr sinn und dann gehts auch danke |
Re: StringGrid cellen Inhalt to Clipboard
Hi,
ich dachte du willst die Zwischenablage nehmen?
Delphi-Quellcode:
Dann kannst du auch im Firefox kopieren und in deinem StringGrid einfügen oder umgekehrt.
uses
ClipBrd; if (ssCtrl in Shift) and (Key = Ord('C')) then begin Clipboard.AsText := StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row]; end; if (ssCtrl in Shift) and (Key = Ord('V')) then begin StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row] := Clipboard.AsText; end; Ich habe inzwischen nachgeguckt, es heißt wirklich so, dürfte jetzt also funktionieren. Mfg FAlter |
Re: StringGrid cellen Inhalt to Clipboard
ja habe ja auch diese Funktion genommen bei deiner Lösung ist mir der Fehler von mir dann auch aufgefallen.
Nur jetzt habe ich gemerckt das, das bei mir nicht so einfach geht da ich ein spezielles StringGrid habe. Also geht keins von beiden aber jetzt habe ich es verstanden und muss versuchen wie ich es jetzt hinbekomme |
Re: StringGrid cellen Inhalt to Clipboard
Ich würde das übrigens per case machen.
Delphi-Quellcode:
if (ssCtrl in Shift) then
case Key of Ord('C'): ... Ord('V'): ... Ord('X'): ... end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:58 Uhr. |
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