Text output with scrollbar...?

Discussion in 'Questions (Windows Mobile)' started by TWELVE, Apr 28, 2008.


    TWELVE Active Member Licensed User


    i'm trying to output text to a certain area of my app.The control where the text appears should have a scrollbar to scroll within the output.The text output is intended as a log console.

    Currently i'm using a multiline textbox control, which is perfect at the first look.Unfortunately the behavior of this control is not exactly the way i want it to have.Instead of showing the last lines of text it is always showing the first lines.Even if i scroll to the end of the text, it jumps back to the beginning of the text as soon the text content gets updated by the app.

    So, how can i make the textbox showing me always the bottom lines...? Can i place the cursor at the end of the text..?

    I know, the textbox is mainly for text input, but i did not find any other control that could do this job.Eventually the listbox, but this control is also intended as a input rather than to be a output.


  2. klaus

    klaus Expert Licensed User

    You should use the following code.
    SelectionStart sets the cursor position, can be any position inbetween 0 and StrLengthStrLength(TextBox1.Text)
    ScrollToCaret shows the cursor position
    Focus set the focus on the TextBox

    Best regards
    Last edited: Apr 28, 2008

    TWELVE Active Member Licensed User

    Thanks very much for the reply,

    i found the exact same solution meanwhile by my own..:)
    Except for one line, i do not use the .Focus.Is not necessary because i don't need to type
    in something.

    kind regards

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice