Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Dec 12, 2017 3:06 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: scroll bar Rectangle control
PostPosted: Mon Jun 03, 2013 10:16 pm 
Offline

Joined: Thu May 16, 2013 10:42 pm
Posts: 11
Hey, is it possible to add a vertical scroll bar to a Rectangle?


Top
 Profile  
Reply with quote  
 Post subject: Re: scroll bar Rectangle control
PostPosted: Mon Jun 03, 2013 11:12 pm 
Offline

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
 Profile  
Reply with quote  
 Post subject: Re: scroll bar Rectangle control
PostPosted: Tue Jun 04, 2013 1:34 am 
Offline

Joined: Thu May 16, 2013 10:42 pm
Posts: 11
Ask to see samples scrollbar in canvas control.
Thank....


Top
 Profile  
Reply with quote  
 Post subject: Re: scroll bar Rectangle control
PostPosted: Tue Jun 04, 2013 3:35 am 
Offline

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
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group