Autor Beitrag
TimonWorld
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 20.06.04 11:02 
Hi @all!

Ich möchte eine Variabel ohne zusätzliuchen Kompos kopieren - hab aber kein Schimmer wie das ghet!

Hier der Source-Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var copytext : string;
begin
   copytext:='<IMG SRC="'+edit1.Text+'">';
   //copytext zur Ablage kopieren - aber wie?!?
end;


Gruß,
Timon!
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 20.06.04 11:25 
Sieh dir doch mal die TClipBoard.Komponente an (Delphi-Hilfe->Index->TClipBoard).
Falls Du wirklich auf überhaupt gar keinen Fall eine Komponente benutzen willst, such mal im Win32 SDK nach Clipboard-Funktionen!
Oder Du schaust mal bei den Schweizern vorbei...

raziel

_________________
JSXGraph
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 20.06.04 11:39 
ich meinte nicht ganz ohne kompo, natürlich wenn ich auf ein button klicke soll er einen erstellten string in die zwischenablage kopieren!
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 20.06.04 11:48 
Na ja, dann s. raziels Beitrag.
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 20.06.04 11:52 
im schweizer forum finde ich leider aber nichts von einer string-var und in der hilfe (d7) finde ich auch kein beispiel dafür!
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 20.06.04 11:59 
TimonWorld hat folgendes geschrieben:
im schweizer forum finde ich leider aber nichts von einer string-var und in der hilfe (d7) finde ich auch kein beispiel dafür!

:?:
Folge einfach dem Link in meinem Beitrag, kopiere die relevanten Teile in deinen Code und kopier den Text so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var copytext : string;
begin
  copytext:='<IMG SRC="'+edit1.Text+'">';
  SetClipBoardText(copytext);
end;

ins Clipboard und hol ihn dir so
ausblenden Delphi-Quelltext
1:
  copytext := GetClipBoardText;					

wieder.

raziel

_________________
JSXGraph
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 20.06.04 12:04 
thx, aber es geht doch irgendwie nicht: :(

ausblenden Quelltext
1:
[Fehler] Unit1.pas(69): Undefinierter Bezeichner: 'SetClipBoardText'					


ps: kann der benutzer den quell code auch mit einfügen (strg+v) in ein anderes programm oder textfeld einfügen?

gruß,
timon
EUOCheffe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124



BeitragVerfasst: So 20.06.04 15:37 
Also ich find den Code bei SwissDelphiCenter also auch nicht so berauschend. Ist praktisch 1:1 aus dem Delphi Quellcode kopiert. Du hättest Raziels ersten Tip angucken sollen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
uses Clipbrd;

//und dann...

Clipboard.AsText:='Hallo, ich bin ein lustiger kleiner Text!'; //CopyToClipboard
Label1.Caption:=Clipboard.AsText; //PasteFromClipboard
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 20.06.04 18:52 
Danke es geht! Ich brauche es nämlich für ein Smiley Programm wo man einfach im Beitrag Strg+V drücken muss: user defined image