Results 1 to 3 of 3

Thread: TextBoxControl

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391

    TextBoxControl

    Hello,

    I'm working on a smartdevice project and one of the controls I have is a textbox whose multiline property is set. The problem I have is that I want to get the cursor to remain at the end of the text in the control. The way I do it in Windows applications works fine:

    Code:
    display.Select(display.Text.Length, 0);
    Code:
    display.Focus();
    However, this doesn't work in my smart device project, which seems really strange to me. I figured out a way to do it but it makes the screen jump up and down. Here is the code I used:

    Code:
    display.Select( display.Text.Length, 0 );
    Code:
    display.ScrollToCaret();
    I do that after each character is appended to the box. But after each character is appended, the text box goest back to the top and then to the bottom when I move it there with the above code. This all makes the control appear jittery when I'm adding text to the box after the scroll bar is activated.

    Anyone have any ideas?

    Thanks.

  2. #2
    PowerPoster sunburnt's Avatar
    Join Date
    Feb 2001
    Location
    Boulder, Colorado
    Posts
    1,403
    I generally use
    Code:
    txtEdit.SelectionStart = txtEdit.Text.Length;
    Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Boston, MA
    Posts
    391
    Did you use that code in a Smart Device application?

    The code you gave me works fine when I'm working on a windows application but for some reason it doesn't work when I'm working in with a textbox in a smart device app.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width