Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Delphi6: Scrollen beim TRichEdit macht Probleme!

Empfohlene Antworten

Veröffentlicht

Hi,

ich hab RichEdit auf meinem Formular und jedesmal, wenn eine neue Zeile dazukommt, soll nach unten gescrollt werden. Dazu benutze ich folgende Befehle:

edThread.Perform(WM_VSCROLL, SB_BOTTOM, 0);

edThread.Perform(WM_VSCROLL, SB_PAGEUP, 0);

Das funktioniert auf meinem Rechner (WinNT SP6) und auf weiteren WinNT-Rechnern, aber nicht auf allen. Dort wird nicht nach unten gescrollt. Ebenso auf Win2K-Rechnern. Eine Vermutung von mir ist, dass dort mir dem ersten Befehl nach unten gescrollt wird und mit dem zweiten wieder nach oben. Allerdings kann ich den zweiten nicht weglassen, weil sonst unter die letzte Zeile gescrollt wird. Wie kann ich das Problem beheben?

Hier mal ein Beispiel zum Scrollen in einer TRichEdit Komponente


var itemp: Integer;

...

  with RichEdit1 do

  begin

    // Move to the last line:

    // Zur letzten Zeile scrollen:

    SelStart := Length(Text);

    Perform(EM_SCROLLCARET, 0, 0);


    // Move to the first line:

    // Zur ersten Zeile Scrollen:

    SelStart := Perform(EM_LINEINDEX, 0, 0);

    Perform(EM_SCROLLCARET, 0, 0);


    // Move to Line 5, Character 3:

    // Cursor auf Linie 5, Postion 3 setzen:

    SelStart := Perform(EM_LINEINDEX, 5, 0) + 3;

    Perform(EM_SCROLLCARET, 0, 0);


    // Scroll down 1 Line

    // Eine linie nach unten scrollen

    with RichEdit1 do

    begin

      itemp := SendMessage(Handle, EM_LINEFROMCHAR, SelStart, 0);

      SelStart := Perform(EM_LINEINDEX, itemp + 1, 0);

      Perform(EM_SCROLLCARET, 0, 0);

    end; 

Hilft dir vielleicht...

Jo, thx!

Klappt zumindest schonmal auf meinem und einem W2K-Rechner!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.