RichEdit Zeilen einschränken



  • hallo erstma
    mein problem ist es ich erstell ganz normal ein RichEdit und zwar so :

    HWND v_hRichEdit = CreateWindowA("richedit",
    						 "",WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL | ES_NOHIDESEL | WS_BORDER,
    						 xPos,yPos,
    						 Breite,Hoehe,
    						 hwindow,NULL,v_hInstance,NULL);
    

    das funktioniert auch ganz gut

    und wenn ich da nun texte reinschreibe
    können unendlich viele zeilen reinkommen
    mein programm schreibt in die richedit sozusagen immer last status rein
    hier zb kleiner mit log :

    [20:42:10] Connecting to Database
    [20:42:11] Connected!
    [20:42:11] Sending Request list

    so steht das dann immer drinnen
    und ich möchte das wenn schon 40 drinnen wenn dann eine 41er eintrag kommt damit der nicht einfach dran geschrieben wird sondern den ersten löscht und dann erst drangeschrieben wird in den oberen beispiel würde dann zb :
    [20:42:10] Connecting to Database , nicht mehr drinnen stehen sondern
    [20:42:11] Connected!

    und die letzte message einfach ganz runten dran

    hier nochmal alles in beispielen : ( keine richtigen logs)

    [20:42:10] information1
    [20:42:10] information2
    [20:42:10] information3
    [20:42:10] information4
    [20:42:10] information5
    [20:42:10] information6
    [20:42:10] information7
    [20:42:10] information8
    [20:42:10] information9
    [20:42:10] information10
    [20:42:10] information11
    [20:42:10] information12
    [20:42:10] information13
    [20:42:10] information14
    [20:42:10] information15
    [20:42:10] information16
    [20:42:10] information17
    [20:42:10] information18
    [20:42:10] information19
    [20:42:10] information20
    [20:42:10] information21
    [20:42:10] information22
    [20:42:10] information23
    [20:42:10] information24
    [20:42:10] information25
    [20:42:10] information26
    [20:42:10] information27
    [20:42:10] information28
    [20:42:10] information29
    [20:42:10] information30
    [20:42:10] information31
    [20:42:10] information32
    [20:42:10] information33
    [20:42:10] information34
    [20:42:10] information35
    [20:42:10] information36
    [20:42:10] information37
    [20:42:10] information38
    [20:42:10] information39
    [20:42:10] information40

    falls nun :

    [20:42:10] information41

    kommt sollte die liste nachher so aussehen :

    [20:42:10] information2
    [20:42:10] information3
    [20:42:10] information4
    [20:42:10] information5
    [20:42:10] information6
    [20:42:10] information7
    [20:42:10] information8
    [20:42:10] information9
    [20:42:10] information10
    [20:42:10] information11
    [20:42:10] information12
    [20:42:10] information13
    [20:42:10] information14
    [20:42:10] information15
    [20:42:10] information16
    [20:42:10] information17
    [20:42:10] information18
    [20:42:10] information19
    [20:42:10] information20
    [20:42:10] information21
    [20:42:10] information22
    [20:42:10] information23
    [20:42:10] information24
    [20:42:10] information25
    [20:42:10] information26
    [20:42:10] information27
    [20:42:10] information28
    [20:42:10] information29
    [20:42:10] information30
    [20:42:10] information31
    [20:42:10] information32
    [20:42:10] information33
    [20:42:10] information34
    [20:42:10] information35
    [20:42:10] information36
    [20:42:10] information37
    [20:42:10] information38
    [20:42:10] information39
    [20:42:10] information40
    [20:42:10] information41

    könnte mir einer weiterhelfen dieses problem zu lösen ?



  • Naja Du kannst die 1. Zeile mit EM_REPLACESEL ja mit einem leeren String ersetzen. Die Länge einer Zeile bekommst Du mit EM_LINELENGTH. Anschließend nutzt Du die hier beschriebene Methode, um die neue Information unten anzugängen 😉 .



  • gibt es nicht irgend eine funktion mit dem man alle nachrichten löschen kann ?
    also damit das RichEdit wieder leer ist ?



  • gibt es nicht irgend eine funktion mit dem man alle nachrichten löschen kann ?
    also damit das RichEdit wieder leer ist ?

    SendMessage(hRichEdit, WM_SETTEXT, 0, "");
    


  • iRichedit schrieb:

    gibt es nicht irgend eine funktion mit dem man alle nachrichten löschen kann ?
    also damit das RichEdit wieder leer ist ?

    Wenn Du das vor hast, was ich glaube, erzeugt das aber viel mehr Overhead, als meine Version, auch wenn es etwas mehr zu programmieren ist 😉 .


Anmelden zum Antworten