Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Fr 22.06.07 14:02 
Wie kann ich herausfinden, ob in der Zwischenablage nur ein String ist oder mehrere?
Und wie kann ich, wenn mehrere Strings in der Zwischenablage sind, diese in eine Listbox einfügen?
Wenn sich nur einer in der Zwischenablage befindet krieg ichs ja hin, aber bei mehreren wird immer nur der Erste ausgelesen...
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Fr 22.06.07 14:04 
Es kann immer nur ein String in der Zwischenablage sein...

_________________
erare humanum est
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Fr 22.06.07 14:11 
user profile iconRobinator hat folgendes geschrieben:
Es kann immer nur ein String in der Zwischenablage sein...

ausblenden Quelltext
1:
2:
3:
hallo
und
tschüss

Wenn ich jetzt einfüge, dann bekomme ich nur hallo.
Mein Code zum Auslesen der Zwischenablage:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
edit1.PasteFromClipboard;
if edit1.text = '' then
begin
  showmessage('Es befindet sich nichts in der Zwischenablage');
  exit;
end;
listbox1.Items.add(trim(edit1.text));
edit1.clear;
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Fr 22.06.07 14:15 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
uses
  ClipBrd;

var
  S : String;
begin
  if ClipBoard.HasFormat(CF_TEXT) then //musst mal gucken ob das wirklich so heisst
  begin
    S := ClipBoard.AsText;
    {...}
  end else
    ShowMessage('Es befindet sich kein String in der Zwischenablage');
end;

_________________
erare humanum est