Autor Beitrag
DXC
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 61

WINXP + SP2
D6 Pers, D2005 Pers
BeitragVerfasst: Di 23.08.05 18:44 
Hallo,

Wisst Ihr wie man in einem Memo die Zeile auslesen kann in der man gerade ist? :roll:

MFG
DXC
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 23.08.05 19:04 
ausblenden Delphi-Quelltext
1:
memo1.lines[x]					

wobei x entweder memo1.selstart oder memo1.itemindex is

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 23.08.05 19:07 
user profile iconretnyg hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
memo1.lines[x]					

wobei x entweder memo1.selstart oder memo1.itemindex is


:? :shock: Itemindex im Memo? Unter D3 auf jeden Fall net. Sellstart kommt mir auhc spanisch vor.

//Edit: Selstart hat keinen wert, wenn der net vorher für ne merkierung gesetzt wurde, oder?
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 23.08.05 19:16 
Vlt. hilft dir das weiter:
www.swissdelphicente.../showcode.php?id=165
www.dsdt.info/tipps/?id=273

ausblenden Delphi-Quelltext
1:
2:
3:
4:
  //Zeile bestimmen
  Label3.Caption:=IntToStr(Memo1.CaretPos.y+1);
  //Spalte bestimmen
  Label4.Caption:=IntToStr(Memo1.CaretPos.x+1);

ab d6
vorher:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
  //Zeile bestimmen
  Label1.Caption:=IntToStr(SendMessage(Memo1.Handle,
                          EM_LINEFROMCHAR,
                          Memo1.SelStart,
                          0)+1);

  //Spalte bestimmen
  Label2.Caption:=IntToStr(Memo1.SelStart-
                       SendMessage(Memo1.Handle,
                       EM_LINEINDEX,
                       SendMessage(Memo1.Handle,
                       EM_LINEFROMCHAR,
                       Memo1.SelStart,
                       0),
                       0)+1);


Zuletzt bearbeitet von Fabian W. am Di 23.08.05 19:20, insgesamt 1-mal bearbeitet
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 23.08.05 19:19 
ausblenden Delphi-Quelltext
1:
form1.Caption :=memo1.Lines[memo1.CaretPos.y];					

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Fr 26.08.05 09:13 
hab ich in der faq vom Delphiforum gefunden:
...die Zeile/Spalte in Memos lesen/setzen?

Lg Martin