New topic: 

Detecting When Vertical Scroll Bar is At Bottom of Editfield

<http://forums.realsoftware.com/viewtopic.php?t=29419>

       Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic         Author  
Message       DogPaws           Post subject: Detecting When Vertical Scroll 
Bar is At Bottom of EditfieldPosted: Wed Aug 05, 2009 10:08 pm                  
             
Joined: Sat Nov 10, 2007 11:35 am
Posts: 62              I need to detect when the scroll bar is at the bottom of 
an Editfield. It is a license agreement and I need to enable the 'proceed' 
button only when the user has scrolled to the bottom of the license agreement.

I have tried using Me.ScrollPosition(), however the number of lines can vary 
depending on how wide the window ends up being. So I can never know for sure 
what the bottom post ScrollPosition value will be.

Has anybody ever encountered this? I am sure there is any easy solution but 
can't come up with anything. Thanks!   
                            Top               Jonathon           Post subject: 
Re: Detecting When Vertical Scroll Bar is At Bottom of EditfieldPosted: Wed Aug 
05, 2009 10:16 pm                               
Joined: Fri Sep 30, 2005 5:54 pm
Posts: 1929
Location: Great Falls, Montana  USA              DogPaws wrote:I need to detect 
when the scroll bar is at the bottom of an Editfield. It is a license agreement 
and I need to enable the 'proceed' button only when the user has scrolled to 
the bottom of the license agreement.

I have tried using Me.ScrollPosition(), however the number of lines can vary 
depending on how wide the window ends up being. So I can never know for sure 
what the bottom post ScrollPosition value will be.

Has anybody ever encountered this? I am sure there is any easy solution but 
can't come up with anything. Thanks!Hi,

You can do this:
Put this in the VerticalScrollBar.ValueChanged:
Code:If Me.value = Me.Max then
  PushButton.Enabled = True
Else
  PushButton.Enabled = False
End
     
_________________
Jonathon
Software Devlopement: http://www.medalertpc.com
Surplus Hardware: http://www.semielectronics.com

RB2005 R4 Pro for Windows XP Pro/SP2  
                            Top                DogPaws           Post subject: 
Re: Detecting When Vertical Scroll Bar is At Bottom of EditfieldPosted: Wed Aug 
05, 2009 10:24 pm                               
Joined: Sat Nov 10, 2007 11:35 am
Posts: 62              I don't see VerticalScrollBar.ValueChanged as an event 
within the EditField control...  Am I missing something?   
                            Top               Jonathon           Post subject: 
Re: Detecting When Vertical Scroll Bar is At Bottom of EditfieldPosted: Wed Aug 
05, 2009 10:59 pm                               
Joined: Fri Sep 30, 2005 5:54 pm
Posts: 1929
Location: Great Falls, Montana  USA              This is what I found in the LR.
Quote:EditField.ScrollPosition Property

Syntax

ScrollPosition as Integer

Zero-based index of the topmost visible line. Read ScrollPosition to determine 
the first visible line; write to ScrollPosition to scroll the EditField. 

Setting ScrollPosition to the last line or beyond the last line will simply 
move the vertical scrollbar's thumb to the bottom, not necessarily displaying 
the last line at the top of the EditField. ScrollPosition is 0 if the MultiLine 
property is False. Can be set in the IDE.


Put this in the editfield.TextChange function:
Code:If Me.ScrollPosition = 100 then // <-- Set this to your editfield total 
length to the bottom.
  PushButton.Enabled = True
Else
  PushButton.Enabled = False
End

     
_________________
Jonathon
Software Devlopement: http://www.medalertpc.com
Surplus Hardware: http://www.semielectronics.com

RB2005 R4 Pro for Windows XP Pro/SP2  
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to