PC Review


Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average.

Automatic Textbox Scrolling

 
 
Peyton Collins
Guest
Posts: n/a
 
      24th May 2005
My CF application in CE4.2 has a textbox which shows which steps a robot is
executing:

Move 1
Move 2
..
..
Move 98
Move 99
etc.

The way it is now, the display shows only Move 1, Move 2, etc. at the top of
the screen, and you have to scroll down to the bottom to see what the robot
is currently doing. I would like to display the last lines in the textbox
string (in this case Move 98, Move 99) at the bottom of the textbox without
having to scroll manually down to the bottom of the textbox every time the
textbox string is changed.

Is this possible?


 
Reply With Quote
 
 
 
 
Thore Berntsen
Guest
Posts: n/a
 
      25th May 2005
If think this code will do it. You will have to run it after you have added
a line to the textbox.

// Scroll textbox

textBoxLog.SelectionLength = 0;

textBoxLog.SelectionStart = textBoxLog.Text.Length;

textBoxLog.ScrollToCaret();


"Peyton Collins" <(E-Mail Removed)> wrote in message
news:OAd$(E-Mail Removed)...
> My CF application in CE4.2 has a textbox which shows which steps a robot
> is
> executing:
>
> Move 1
> Move 2
> .
> .
> Move 98
> Move 99
> etc.
>
> The way it is now, the display shows only Move 1, Move 2, etc. at the top
> of
> the screen, and you have to scroll down to the bottom to see what the
> robot
> is currently doing. I would like to display the last lines in the textbox
> string (in this case Move 98, Move 99) at the bottom of the textbox
> without
> having to scroll manually down to the bottom of the textbox every time the
> textbox string is changed.
>
> Is this possible?
>
>



 
Reply With Quote
 
Sergey Bogdanov
Guest
Posts: n/a
 
      25th May 2005
To append new line with auto scroll down use this code:

string t = "new text to append";

yourTextBox.SelectionStart = yourTextBox.Text.Length;
yourTextBox.SelectionLength = 0;
// yourTextBox.SelectedText
SendMessage(yourTextBoxHWND, EM_REPLACESEL, false, t);

For the reason explanation why you should use SendMessage instead of
SelectedText see Alex Feinman's post:
http://blog.opennetcf.org/afeinman/P...07210ab40.aspx


--
Sergey Bogdanov
http://www.sergeybogdanov.com


Peyton Collins wrote:
> My CF application in CE4.2 has a textbox which shows which steps a robot is
> executing:
>
> Move 1
> Move 2
> .
> .
> Move 98
> Move 99
> etc.
>
> The way it is now, the display shows only Move 1, Move 2, etc. at the top of
> the screen, and you have to scroll down to the bottom to see what the robot
> is currently doing. I would like to display the last lines in the textbox
> string (in this case Move 98, Move 99) at the bottom of the textbox without
> having to scroll manually down to the bottom of the textbox every time the
> textbox string is changed.
>
> Is this possible?
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scrolling in textbox sven2000@gmail.com Microsoft VB .NET 1 21st Oct 2008 10:43 AM
Textbox scrolling Kent Briggs Microsoft Dot NET Compact Framework 6 28th Dec 2005 10:51 PM
Scrolling problem with ListView, TextBox and Scrolling Panel Jon Abaunza Microsoft Dot NET Compact Framework 0 17th Nov 2005 03:57 PM
scrolling textbox, is this possible? Dave Elliott Microsoft Access Forms 0 14th Jun 2005 06:30 PM
Textbox scrolling ray well Microsoft C# .NET 4 12th Aug 2003 09:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:16 PM.