Autor Beitrag
TheUnknown
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: Di 29.07.03 07:54 
Moin, Moin!

Wie kann ich in einem RichEdit folgendes machen: Der Cursor springt eine belibige Zeile (etwa Zeile 1000 oder 340) und dann scrollt das RichEdit automatisch in die Zeile...

Ich bekomm das nicht auf die Kette...
Cyrus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Di 29.07.03 09:40 
so sollte es gehen:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure RichEdit_MoveTo(RichEdit: TRichEdit; LineNumber, CharNumber: Word); 
begin 
  RichEdit.SelStart := RichEdit.Perform(EM_LINEINDEX, LineNumber, 0) + CharNumber); 
end; 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  RichEdit_MoveTo(RichEdit1,2,5); 
  Application.ProcessMessages; 
  RichEdit1.SetFocus; 
end;

Greetz cyrus

_________________
Wer glaub er ist, hört auf zu werden!
Delphi Rulez!!!
TheUnknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: Di 29.07.03 12:20 
Cyrus hat folgendes geschrieben:
so sollte es gehen:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure RichEdit_MoveTo(RichEdit: TRichEdit; LineNumber, CharNumber: Word); 
begin 
  RichEdit.SelStart := RichEdit.Perform(EM_LINEINDEX, LineNumber, 0) + CharNumber); 
end; 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  RichEdit_MoveTo(RichEdit1,2,5); 
  Application.ProcessMessages; 
  RichEdit1.SetFocus; 
end;

Greetz cyrus


Jo, genau so geht's! ;-)

VIELEN DANK!
Dieses Thema ist gesperrt, Du kannst keine Beiträge editieren oder beantworten.

Das Thema wurde von einem Team-Mitglied geschlossen. Wenn du mit der Schließung des Themas nicht einverstanden bist, kontaktiere bitte das Team.