Auto scroll? 
Author Message
 Auto scroll?

Hi,
  I have just made a little chat program that is working great with the
exception on the scrollbar. I have a list box that is receiving the messages
when the box is full I need for it to scroll automatically. Does anyone know
how I might make this happen?

Thanks in advance for all you help..
Lisa



Tue, 03 Feb 2004 07:22:29 GMT  
 Auto scroll?

Quote:

> exception on the scrollbar. I have a list box that is receiving the messages
> when the box is full I need for it to scroll automatically. Does anyone know
> how I might make this happen?

Set the ListBox's ScrollPosition. m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Tue, 03 Feb 2004 08:53:07 GMT  
 Auto scroll?


Quote:


>> exception on the scrollbar. I have a list box that is receiving the messages
>> when the box is full I need for it to scroll automatically. Does anyone know
>> how I might make this happen?

> Set the ListBox's ScrollPosition. m.

Matt
  Thanks for you help but as you probably can tell I am very new to this. I
don't see any place to set the ScrollPosition. Do I need to do it in the
code? My listbox needs to hold about ten lines  and then scroll. Can you
help my any further?

Thanks (I'm going to check out you web site...brb)

Lisa



Tue, 03 Feb 2004 09:15:00 GMT  
 Auto scroll?
ScrollPosition in Listboxes was a feature added in RB 3.0 (it's mentioned in
"Release notes for REALbasic 3.0, 12 February, 2001") - maybe you're using an
older version of RB in which it is unavailable.

Quote:





> >> exception on the scrollbar. I have a list box that is receiving the messages
> >> when the box is full I need for it to scroll automatically. Does anyone know
> >> how I might make this happen?

> > Set the ListBox's ScrollPosition. m.

> Matt
>   Thanks for you help but as you probably can tell I am very new to this. I
> don't see any place to set the ScrollPosition. Do I need to do it in the
> code? My listbox needs to hold about ten lines  and then scroll. Can you
> help my any further?

> Thanks (I'm going to check out you web site...brb)

> Lisa

Best Regards,

Michael Wildoer
Lava Software Pty. Ltd.



Tue, 03 Feb 2004 09:43:00 GMT  
 Auto scroll?

Quote:

>   Thanks for you help but as you probably can tell I am very new to this. I
> don't see any place to set the ScrollPosition. Do I need to do it in the
> code?

Yes, you do.

Quote:
> My listbox needs to hold about ten lines  and then scroll. Can you
> help my any further?

Sure. Presumably you do have some code, and this code is constantly adding
to the contents of the listbox. So every tenth time that you do that,
increase the ListBox's ScrollPosition by ten. m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Tue, 03 Feb 2004 09:45:00 GMT  
 Auto scroll?
OK now I have tried everything I can think of and still the text that is
received after the tenth line are hidden until I manually scroll. I have
tried to set the scrollposition but still it acts the same way.(I could be
doing is wrong) Here is the code I have already. Remember this is a peer to
peer chat program. This is the code I have for the socket where it reads the
new messages as they come in and displays then in the list box.

Sub DataAvailable()
  dim s as string
  s=me.readall
  DisplayField.text=DisplayField.text+"Server:"+s+chr(13)
End Sub

I would like for the text in the listbox (DisplayField) to automatically
scroll to show the new lines coming in after the box is full...

Thanks
Lisa



Wed, 04 Feb 2004 04:56:11 GMT  
 Auto scroll?

Quote:

> peer chat program. This is the code I have for the socket where it reads the
> new messages as they come in and displays then in the list box.

> Sub DataAvailable()
>   dim s as string
>   s=me.readall
>   DisplayField.text=DisplayField.text+"Server:"+s+chr(13)
> End Sub

> I would like for the text in the listbox (DisplayField) to automatically
> scroll to show the new lines coming in after the box is full

The way you append a line to a listbox is not by concatenating to its Text
property, but by calling its AddRow method. Are you sure you are
describing correctly what the situation is? Perhaps you don't have a
listbox at all, but rather an editfield. That would make a big difference,
of course. Nevertheless, an EditField has a scrollposition property too.

It is hard to pick apart your situation at this distance. However, I do
have one idea - are you aware that you can't scroll beyond what is
present? In other words, if you have 11 lines of text, you cannot scroll
so that the 11th line is at the top, because there is nothing to scroll
to. The 11th line is the last thing there is, so the only place you can
show it is at the bottom - there is nothing after it to occupy the space.
Do you see? So you'd need to add some blanks before starting.

If you like, I will send you a little example project that adds
information to a listbox and scrolls every tenth time. Write me offline if
you want this. m.

--

*** REALbasic, The Definitive Guide! ***
http://www.oreilly.com/catalog/realbasic/



Wed, 04 Feb 2004 06:23:33 GMT  
 Auto scroll?
If you don't want to use scrollposition or if your version of RB does not
support it, use this code:

editfield1.selstart=len(editfield1.text)
                 editfield1.sellength=0

Just put that in the textchanged even of your listbox, and whenever the text
changes it will go to the bottom

Quote:

> Organization: Lava Software P/L

> Newsgroups: comp.lang.basic.realbasic
> Date: Fri, 17 Aug 2001 01:43:00 GMT
> Subject: Re: Auto scroll?

> ScrollPosition in Listboxes was a feature added in RB 3.0 (it's mentioned in
> "Release notes for REALbasic 3.0, 12 February, 2001") - maybe you're using an
> older version of RB in which it is unavailable.






>>>> exception on the scrollbar. I have a list box that is receiving the
>>>> messages
>>>> when the box is full I need for it to scroll automatically. Does anyone
>>>> know
>>>> how I might make this happen?

>>> Set the ListBox's ScrollPosition. m.

>> Matt
>> Thanks for you help but as you probably can tell I am very new to this. I
>> don't see any place to set the ScrollPosition. Do I need to do it in the
>> code? My listbox needs to hold about ten lines  and then scroll. Can you
>> help my any further?

>> Thanks (I'm going to check out you web site...brb)

>> Lisa

> Best Regards,

> Michael Wildoer
> Lava Software Pty. Ltd.




Wed, 04 Feb 2004 06:40:36 GMT  
 Auto scroll?


Quote:
> If you don't want to use scrollposition or if your version of RB does not
> support it, use this code:

> editfield1.selstart=len(editfield1.text)
>                editfield1.sellength=0

> Just put that in the textchanged even of your listbox, and whenever the text
> changes it will go to the bottom


>> Organization: Lava Software P/L

>> Newsgroups: comp.lang.basic.realbasic
>> Date: Fri, 17 Aug 2001 01:43:00 GMT
>> Subject: Re: Auto scroll?

>> ScrollPosition in Listboxes was a feature added in RB 3.0 (it's mentioned in
>> "Release notes for REALbasic 3.0, 12 February, 2001") - maybe you're using an
>> older version of RB in which it is unavailable.






>>>>> exception on the scrollbar. I have a list box that is receiving the
>>>>> messages
>>>>> when the box is full I need for it to scroll automatically. Does anyone
>>>>> know
>>>>> how I might make this happen?

>>>> Set the ListBox's ScrollPosition. m.

>>> Matt
>>> Thanks for you help but as you probably can tell I am very new to this. I
>>> don't see any place to set the ScrollPosition. Do I need to do it in the
>>> code? My listbox needs to hold about ten lines  and then scroll. Can you
>>> help my any further?

>>> Thanks (I'm going to check out you web site...brb)

>>> Lisa

>> Best Regards,

>> Michael Wildoer
>> Lava Software Pty. Ltd.


Thank you Brett

 This worked just like I wanted it to. I have tried everything I could think
of and this is just what I needed. Thanks again.

Lisa



Wed, 04 Feb 2004 08:23:09 GMT  
 Auto scroll?
Ah, you're welcome, nothin much. If you've got any other questions, just
call.
Quote:

> Organization: Giganews.Com - Premium News Outsourcing
> Newsgroups: comp.lang.basic.realbasic
> Date: Sat, 18 Aug 2001 00:23:09 GMT
> Subject: Re: Auto scroll?



>> If you don't want to use scrollposition or if your version of RB does not
>> support it, use this code:

>> editfield1.selstart=len(editfield1.text)
>> editfield1.sellength=0

>> Just put that in the textchanged even of your listbox, and whenever the text
>> changes it will go to the bottom


>>> Organization: Lava Software P/L

>>> Newsgroups: comp.lang.basic.realbasic
>>> Date: Fri, 17 Aug 2001 01:43:00 GMT
>>> Subject: Re: Auto scroll?

>>> ScrollPosition in Listboxes was a feature added in RB 3.0 (it's mentioned in
>>> "Release notes for REALbasic 3.0, 12 February, 2001") - maybe you're using
>>> an
>>> older version of RB in which it is unavailable.






>>>>>> exception on the scrollbar. I have a list box that is receiving the
>>>>>> messages
>>>>>> when the box is full I need for it to scroll automatically. Does anyone
>>>>>> know
>>>>>> how I might make this happen?

>>>>> Set the ListBox's ScrollPosition. m.

>>>> Matt
>>>> Thanks for you help but as you probably can tell I am very new to this. I
>>>> don't see any place to set the ScrollPosition. Do I need to do it in the
>>>> code? My listbox needs to hold about ten lines  and then scroll. Can you
>>>> help my any further?

>>>> Thanks (I'm going to check out you web site...brb)

>>>> Lisa

>>> Best Regards,

>>> Michael Wildoer
>>> Lava Software Pty. Ltd.

> Thank you Brett

> This worked just like I wanted it to. I have tried everything I could think
> of and this is just what I needed. Thanks again.

> Lisa



Thu, 05 Feb 2004 00:12:15 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. How to auto-scroll a listbox?

2. auto-scrolling in text viewers

3. auto scrolling during text selection

4. Auto Scroll in a View

5. problem scrolling auto-formatting text

6. Scrolled Window automatically scrolling

7. To scroll or not to scroll?

8. Mouse wheel doesn't scroll text scroll bar

9. only add a scroll bar when the window is minimized and scroll bar is needed

10. Why won't my scrolling canvas scroll?

11. text widget / scroll bar / automatic scrolling

12. SYNCHRONIZED SCROLLING, or, ONE SCROLLBAR TO SCROLL 2CanvasesWindows

 

 
Powered by phpBB® Forum Software