New topic: 

scroll bar  Rectangle control

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

         Page 1 of 1
   [ 4 posts ]             Print view    Previous topic | Next topic          
Author  Message        wittawat          Post subject: scroll bar  Rectangle 
controlPosted: Mon Jun 03, 2013 10:16 pm                         
Joined: Thu May 16, 2013 10:42 pm
Posts: 11                Hey, is it possible to add a vertical scroll bar to a 
Rectangle?   
                             Top                timhare          Post subject: 
Re: scroll bar  Rectangle controlPosted: Mon Jun 03, 2013 11:12 pm              
           
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR  USA                What would it do?  A rectangle is 
static.  Perhaps you should use a canvas instead?  Stick a scrollbar control 
next to the canvas and tie the scrollbar's value changed event to the canvas 
Scroll method.   
                             Top                wittawat          Post subject: 
Re: scroll bar  Rectangle controlPosted: Tue Jun 04, 2013 1:34 am               
          
Joined: Thu May 16, 2013 10:42 pm
Posts: 11                Ask to see samples scrollbar in canvas control.
Thank....   
                             Top                wittawat          Post subject: 
Re: scroll bar  Rectangle controlPosted: Tue Jun 04, 2013 3:35 am               
          
Joined: Thu May 16, 2013 10:42 pm
Posts: 11                I use Canvas control . in KeyDown event the following 
code calls the Scroll method whenever the Up, Down, Left, or Right arrow keys 
are pressed.

Const LeftArrow = 28
Const RightArrow = 29
Const UpArrow = 30
Const DownArrow = 31
Const ScrollUnit = 8 // pixels

Select Case Asc(Key)
  
Case LeftArrow
  XScroll = XScroll + ScrollUnit
  Canvas1.Scroll ScrollUnit, 0
  
Case RightArrow
  XScroll = XScroll - ScrollUnit
  Canvas1.Scroll -ScrollUnit, 0
  
Case UpArrow
  YScroll = YScroll + ScrollUnit
  Canvas1.Scroll 0, ScrollUnit
  
Case DownArrow
  YScroll = YScroll - ScrollUnit
  Canvas1.Scroll 0, -ScrollUnit
  
End Select

The Scroll method calls the Paint event of the canvas that redraws the picture 
with the new values of XScroll and YScroll. The Paint event has the following 
line of code:


g.DrawPicture myPicture,Xscroll,Yscroll

when this Project error 

help me Please   
                             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