Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Mi 25.02.09 16:12 
Hallo

Hab jetzt mal ne lächerliche Frage.
Wie kann ich einen text aus einem edit Feld per Button kopieren
Ich bekomms nicht hin>.<

danke im Voraus


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Mi 25.02.2009 um 16:18
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 25.02.09 16:15 
So?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
uses ClipBrd;

  with TClipBoard.Create do
  try
    AsText := Edit1.Text;
  finally
    Free;
  end;
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 25.02.09 16:20 
Moin!

Geht auch ohne die Clipboard-Unit: ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Edit1.SelectAll; // alles auswählen -> alles kopieren
  Edit1.CopyToClipboard;
  Edit2.SelectAll; // zum Ersetzen hier auch alles auswählen
  Edit2.PasteFromClipboard;
end;
cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Mi 25.02.09 16:23 
Danke euch beiden.
Das von Narses ist einfacher^^

Aber bei mir hats eben nicht geklappt...

Aber egal, vllt lags daran dass ich nicht das alles markieren drinne hatte
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.02.09 16:30 
Erstens das was user profile iconNarses geschrieben hat, zweitens:
user profile iconMarc. hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
  with TClipBoard.Create do					
Wofür das? :shock:
Eine globale Variable Clipboard ist doch schon da?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
uses
  ClipBrd;
...
  Clipboard.AsText := Edit1.Text;


Zuletzt bearbeitet von jaenicke am Mi 25.02.09 16:33, insgesamt 1-mal bearbeitet
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 25.02.09 16:32 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
Wofür das? :shock:

Ich mache es halt gerne umständlich. :mrgreen:
Teekeks
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 211
Erhaltene Danke: 23



BeitragVerfasst: Mi 25.02.09 16:40 
Aber ich habs noch einfacher:
ausblenden Delphi-Quelltext
1:
Edit2.text:=Edit1.Text;					

:wink: :wink:
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Mi 25.02.09 16:43 
user profile iconTeekeks hat folgendes geschrieben Zum zitierten Posting springen:
Aber ich habs noch einfacher:
ausblenden Delphi-Quelltext
1:
Edit2.text:=Edit1.Text;					

:wink: :wink:

Ne, das ists nicht
Es geht darum etwas aus einem Edit feld in den Zwischenspecher zu kopieren^^
Du gehts davon aus, dass ich es in ein anderes Edit im programm kopieren will;)

Moderiert von user profile iconNarses: 2. Frage entfernt
Teekeks
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 211
Erhaltene Danke: 23



BeitragVerfasst: Mi 25.02.09 16:51 
Jetzt seh ichs auch... Lesen sollte man können ^^
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Mi 25.02.09 21:01 
Wahrscheinlich hat er nur schnell Narses' Code überflogen. :wink: