Scroll bar problem on Multiline Textbox 
Author Message
 Scroll bar problem on Multiline Textbox

When I add some text onto the end of some text in a Multiline textbox with
vertical scroll bars, is it possible to get the textbox to jump to the
newly added text (at the bottom) and show it on the screen?  If I move the
scroll bars and then some new text is added to the textbox, it doesn't
track back to the bottom (where the added text was put).  It tracks back to
the last position the scroll bars were set to.

Anybody got a solution?
--
Regards



Fri, 02 Jun 2000 03:00:00 GMT  
 Scroll bar problem on Multiline Textbox

Quote:

> When I add some text onto the end of some text in a Multiline textbox with
> vertical scroll bars, is it possible to get the textbox to jump to the
> newly added text (at the bottom) and show it on the screen?

Hi,

Try  textBox.selstart = len(textBox.text)

Michaela



Fri, 02 Jun 2000 03:00:00 GMT  
 Scroll bar problem on Multiline Textbox

Sorry, I don't have time to fully answer your question, but you can use
SendMessageByNum using:

Declare Function SendMessageBynum Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal
lParam As Long) As Long

Const EM_GETFIRSTVISIBLELINE = &HCE
Const EM_GETLINECOUNT = &HBA
Const EM_LINESCROLL = &HB6

i.e.

topline% = SendMessageBynum(Text1.hwnd, EM_GETFIRSTVISIBLELINE, 0, 0&)
to return the line number of the first visible line

linecount% = SendMessageBynum(Text1.hwnd, EM_GETLINECOUNT, 0, 0&)
to return the total number of lines

dl& = SendMessageBynum(Text1.hwnd, EM_LINESCROLL, 0, n)
to scroll the textbox down "n" lines

Hope this points you in the right direction,
Shane.

Quote:
> -----Original Message-----

> Posted At: 15 December 1997 14:38
> Posted To: syntax
> Conversation:      Scroll bar problem on Multiline Textbox
> Subject:   Scroll bar problem on Multiline Textbox

> When I add some text onto the end of some text in a Multiline textbox
> with
> vertical scroll bars, is it possible to get the textbox to jump to the
> newly added text (at the bottom) and show it on the screen?  If I move
> the
> scroll bars and then some new text is added to the textbox, it doesn't
> track back to the bottom (where the added text was put).  It tracks
> back to
> the last position the scroll bars were set to.

> Anybody got a solution?
> --
> Regards




Mon, 26 Jun 2000 03:00:00 GMT  
 Scroll bar problem on Multiline Textbox

Another way to do this, though may not be as fast, is to just set the
textbox.selstart = len(textbox.text)
--
----------
Jay Shepherd
Check out the VB forum at
http://www.universalthread.com



Quote:
> Sorry, I don't have time to fully answer your question, but you can use
> SendMessageByNum using:

> Declare Function SendMessageBynum Lib "user32" Alias "SendMessageA"
> (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal
> lParam As Long) As Long

> Const EM_GETFIRSTVISIBLELINE = &HCE
> Const EM_GETLINECOUNT = &HBA
> Const EM_LINESCROLL = &HB6

> i.e.

> topline% = SendMessageBynum(Text1.hwnd, EM_GETFIRSTVISIBLELINE, 0, 0&)
> to return the line number of the first visible line

> linecount% = SendMessageBynum(Text1.hwnd, EM_GETLINECOUNT, 0, 0&)
> to return the total number of lines

> dl& = SendMessageBynum(Text1.hwnd, EM_LINESCROLL, 0, n)
> to scroll the textbox down "n" lines

> Hope this points you in the right direction,
> Shane.

> > -----Original Message-----

> > Posted At:    15 December 1997 14:38
> > Posted To:    syntax
> > Conversation: Scroll bar problem on Multiline Textbox
> > Subject:      Scroll bar problem on Multiline Textbox

> > When I add some text onto the end of some text in a Multiline textbox
> > with
> > vertical scroll bars, is it possible to get the textbox to jump to the
> > newly added text (at the bottom) and show it on the screen?  If I move
> > the
> > scroll bars and then some new text is added to the textbox, it doesn't
> > track back to the bottom (where the added text was put).  It tracks
> > back to
> > the last position the scroll bars were set to.

> > Anybody got a solution?
> > --
> > Regards




Mon, 26 Jun 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to detect the scroll value of multiline textbox when scrolling by MOUSE

2. How to detect the scroll value of multiline textbox when scrolling by MOUSE

3. Scroll 2 textboxes off a single scroll bar

4. forcing multiline textbox to scroll to last line...

5. Setting scroll position of TextBox with MultiLine

6. Setting scroll position of TextBox with MultiLine

7. Building A Scroll Bar / Scroll Bar Colors

8. TextBox scroll bar positions

9. TextBox scroll bar positions

10. textbox scroll bars with msgbox

11. Textboxes and scroll bars

12. scroll bars in a textbox

 

 
Powered by phpBB® Forum Software