CEdit will nicht scrollen



  • Was heißt weiterscrollen?
    Scrollt es denn schon?
    In der MSDN bei CEdit::LineScroll steht, dass man ihm erst sagen muss, wieviel Zeilen er scrollen kann.
    Ansonsten weiß ich auch nix und halte mich deshalb zurück.



  • 😞



  • 😞



  • // Test vom Auto-Scroll-Editfeld
    void CScrollEditDlg::OnOk()
    {
        CString txt;
        GetDlgItemText(IDC_EDIT1, txt);     // den Text aus dem Editfeld auslesen
    
        int nLaenge = txt.GetLength();      // Textlänge bestimmen
    
        if(nLaenge % 5 == 0)                // zu Testzwecken den String auf Buttonklick verlängern
            txt += " ";
        else
            txt += "X";
    
        SetDlgItemText(IDC_EDIT1, txt);     // den neuen Text in das Editfeld schreiben
    
        ((CEdit*)GetDlgItem(IDC_EDIT1))->SetSel(nLaenge, nLaenge);   // Cursor an das Ende setzen
    }
    

    😞 || 🙂 ?



  • geht auch nich, der text geht weiter, aber es wird nicht gescrollt 😞



  • 😞



  • 😞



  • Vielleicht hilft dir das:

    CEdit::LineScroll 
    void LineScroll( int nLines, int nChars = 0 );
    
    Parameters
    
    nLines
    
    Specifies the number of lines to scroll vertically.
    
    nChars
    
    Specifies the number of character positions to scroll horizontally. This value is ignored if the edit control has either the ES_RIGHT or ES_CENTER style.
    
    Remarks
    
    Call this function to scroll the text of a multiple-line edit control. 
    
    This member function is processed only by multiple-line edit controls. 
    
    The edit control does not scroll vertically past the last line of text in the edit control. If the current line plus the number of lines specified by nLines exceeds the total number of lines in the edit control, the value is adjusted so that the last line of the edit control is scrolled to the top of the edit-control window. 
    
    LineScroll can be used to scroll horizontally past the last character of any line.
    
    For more information, seeEM_LINESCROLL in the Win32 documentation.
    
    See the example for CEdit::GetFirstVisibleLine.
    


  • Ich habe etwas herrausgefunden und zwar das er irgendwie die Zeilen der CEdit box nicht zählt.

    Nach

    UpdateData(TRUE);
    iLineCount = m_ctrlChat.GetLineCount();
    

    ist in LineCount der wert 1, und das bleibt auch immer so. Warum? Was mache ich falsch?

    m_ctrlChat ist eine CEdit membervariable.
    Hab ich vielleicht irgendwo ne einstellung oder so vergessen?

    Danke im Voraus



  • 😞 😮



  • jo, du sagst es 😞


Anmelden zum Antworten