Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Text output with scrollbar...?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-28-2008, 06:39 AM
Knows the basics
 
Join Date: Apr 2008
Location: Duesseldorf, Germany
Posts: 71
Default Text output with scrollbar...?

Hello,

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.




regards

TWELVE
Reply With Quote
  #2 (permalink)  
Old 04-28-2008, 08:55 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 707
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

You should use the following code.
Code:
  TextBox1.SelectionStart=StrLength(TextBox1.Text)
  TextBox1.ScrollToCaret
  TextBox1.Focus
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
__________________
Klaus
Switzerland

Last edited by klaus : 04-28-2008 at 09:06 AM.
Reply With Quote
  #3 (permalink)  
Old 04-28-2008, 10:37 AM
Knows the basics
 
Join Date: Apr 2008
Location: Duesseldorf, Germany
Posts: 71
Default

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

TWELVE
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing Intermediate Output Steve Questions & Help Needed 4 08-14-2008 08:59 PM
Scrollbar aerohost Basic4ppc Wishlist 1 06-15-2008 03:56 PM
Tab-Control with Scrollbar Sascha K. Questions & Help Needed 4 04-05-2008 12:22 AM
Strange subroutine output petrbury Bug Reports 3 01-31-2008 08:18 PM
possible to add a scrollbar to the textbox? Stellaferox Questions & Help Needed 4 06-16-2007 01:15 PM


All times are GMT. The time now is 01:40 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0