New topic: Scrollbar Navigation Question
<http://forums.realsoftware.com/viewtopic.php?t=47926> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message mikecotrone Post subject: Scrollbar Navigation QuestionPosted: Mon May 20, 2013 8:21 am Joined: Tue Mar 05, 2013 2:33 pm Posts: 62 Location: Greensboro, North Carolina Hi, I am new to Scrollbars and I am implementing them into a test app I am writing. What is the best style to use when writing "if" statements to recognize when a user is scrolling Up or Down (Vertical Scroll example)? I have been trying to use the following code which isn't working since it never leaves the first if block. Sub ValueChanged() dim LastValue as integer if me.value > LastValue-1 then LeftRulerCanvas1.Top = LeftRulerCanvas1.Top - Scrollunit CampusMapCanvas.Top = CampusMapCanvas.Top - Scrollunit LastValue = Me.value elseif me.value < LastValue+1 then LeftRulerCanvas1.Top = LeftRulerCanvas1.Top + Scrollunit CampusMapCanvas.Top = CampusMapCanvas.Top + Scrollunit LastValue = Me.value end if End Sub Thank you in advance! _________________ Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice Chief Technology Officer Onepath Systems, LLC Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux Top DaveS Post subject: Re: Scrollbar Navigation QuestionPosted: Mon May 20, 2013 9:00 am Joined: Sun Aug 05, 2007 10:46 am Posts: 4897 Location: San Diego, CA Move DIM LastValue OUT of that procedure. Put it in a Module. It needs to be in a scope that is not the same as the procedure itself otherwise it gets reset to ZERO every time ValueChanged is called... so me.value is ALWAYS greater than -1 _________________ Dave Sisemore iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top mikecotrone Post subject: Re: Scrollbar Navigation QuestionPosted: Mon May 20, 2013 9:04 am Joined: Tue Mar 05, 2013 2:33 pm Posts: 62 Location: Greensboro, North Carolina DaveS wrote:Move DIM LastValue OUT of that procedure. Put it in a Module. It needs to be in a scope that is not the same as the procedure itself otherwise it gets reset to ZERO every time ValueChanged is called... so me.value is ALWAYS greater than -1 Thanks Dave! I deleted the DIM statement and just made a property of that canvas object. It worked and thanks again! _________________ Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice Chief Technology Officer Onepath Systems, LLC Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 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]
