For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > March 2004 > Text box help?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Text box help?
Rachel

2004-03-31, 7:31 pm

when my vb6 app opens is shows a log file in a text box, How can have have it scroll down to the last line when the app opens, so it is showing the last line of the log file.
Ken Halter

2004-03-31, 7:31 pm

"Rachel" <anonymous@discussions.microsoft.com> wrote in message
news:13C0C7FB-2595-46D0-B4CD-A1BDEB41A18D@microsoft.com...
> when my vb6 app opens is shows a log file in a text box, How can have have

it scroll down to the last line when the app opens, so it is showing the
last line of the log file.

'Right before showing the form (or right after loading the text into the
box), add code similar to....

With txtYourLogFileTextBox
.SelLength = 0 'select 0 characters
.SelStart = Len(.Text) 'cursor = end of text
End With

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..


Rick Rothstein

2004-03-31, 7:31 pm

> > when my vb6 app opens is shows a log file in a text box, How can have
have
> it scroll down to the last line when the app opens, so it is showing the
> last line of the log file.
>
> 'Right before showing the form (or right after loading the text into the
> box), add code similar to....
>
> With txtYourLogFileTextBox
> .SelLength = 0 'select 0 characters
> .SelStart = Len(.Text) 'cursor = end of text
> End With


Actually, you can eliminate the SelLength = 0 line.... setting the SelStart
property to anything (even to itself) will automatically set the SelLength
property to zero.

Rick - MVP


Veign

2004-03-31, 7:31 pm

Also to add:

The Textbox has a character limit which may be exceeded if your log file is
growing. You may need to switch to a Richtextbox control which imposes no
limit....

--
Chris Hanscom
MVP (Visual Basic)
http://www.veign.com
--

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:eYhpie3FEHA.1708@TK2MSFTNGP12.phx.gbl...
> "Rachel" <anonymous@discussions.microsoft.com> wrote in message
> news:13C0C7FB-2595-46D0-B4CD-A1BDEB41A18D@microsoft.com...
have[color=darkred]
> it scroll down to the last line when the app opens, so it is showing the
> last line of the log file.
>
> 'Right before showing the form (or right after loading the text into the
> box), add code similar to....
>
> With txtYourLogFileTextBox
> .SelLength = 0 'select 0 characters
> .SelStart = Len(.Text) 'cursor = end of text
> End With
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Please keep all discussions in the groups..
>
>



Don@home.com

2004-03-31, 7:32 pm

On Wed, 31 Mar 2004 18:48:09 -0500, "Veign" <NOSPAMinveign@veign.com> wrote:

>Also to add:
>
>The Textbox has a character limit which may be exceeded if your log file is
>growing. You may need to switch to a Richtextbox control which imposes no
>limit....


You mean I can load a 160gig file into a Richtextbox ?¿? j/k


>
>--
>Chris Hanscom
>MVP (Visual Basic)
>http://www.veign.com


Have a good day...

Don
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com