Autor Beitrag
F.Art
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Fr 27.09.02 15:17 
Wie bekomme ich das hin das der Markierte Bereich in ein Editfeld kopiert wird?
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
function SearchAndSelect(Memo1:TMemo; const Search: String): Boolean;
var
  FoundPos: Integer;
begin
  Result := False;
  if Length(Search) < 1 then
    Exit;
  FoundPos := Pos(Search, Memo1.Text);
  if FoundPos < 1 then
    Exit;
  with Memo1 do
  begin
    SelStart := FoundPos - -10;
    SelLength := Length(Search)+25;
    SetFocus;
  end;
  Result := True;
end;


(27.09.02 16:11 Tino) Code-Tags hinzugefügt.
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Fr 27.09.02 15:52 
Hi,

erstmal würde ich vielleicht den Sourcecode formatieren, nämlich so :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function SearchAndSelect(Memo1:TMemo; const Search: String): Boolean; 
var 
  FoundPos: Integer; 
begin 
  Result := False; 
  if Length(Search) < 1 then Exit; 
  FoundPos := Pos(Search, Memo1.Text); 
  if FoundPos < 1 then Exit; 
  with Memo1 do begin 
    SelStart := FoundPos - -10; 
    SelLength := Length(Search)+25; 
    SetFocus; 
  end; 
  Result := True; 
end;


Dann könntest Du mit folgender Codezeile den makierten Text ins Edit-Feld übernehmen :
ausblenden Quelltext
1:
edit1.text := memo1.seltext;					
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Fr 27.09.02 16:13 
bis11 hat folgendes geschrieben:
erstmal würde ich vielleicht den Sourcecode formatieren

Der Sourcecode ist formatiert. War bloß nicht zu sehen da die Code-Tags nicht benutzt wurden und somit wurden die unnötigen Leerzeichen am Anfang einer Zeile entfernt.

Gruß
TINO
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Fr 27.09.02 16:34 
Ok sorry,

das konnte ich ja nicht sehen und nicht wissen.
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Fr 27.09.02 16:47 
Titel: Wunderbar
Also hier wird echt gut und zuverlässig geholfen!
Jetzt kann ich weiter machen.

THX
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 27.09.02 17:03 
SelStart := FoundPos - -10; :roll:

Denk mal drüber nach.
F.Art Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 434



BeitragVerfasst: Fr 27.09.02 17:50 
ist mir schon vorher aufgefallen +10