| View previous topic :: View next topic |
| Author |
Message |
Laurie Boshell Guest
|
Posted: Sun Nov 16, 2003 10:14 am Post subject: How to tell a scroll box to scroll |
|
|
I have a TImage within a scroll box and the image is larger than the scroll
box so that scroll bars are present.
I have a mouse handler for TImage that tracks the cursor position within
TImage.
How do I tell the scroll box to scroll when the curson in the TImage gets
near the perimeter of the TImage (Say within 10 pixels)? Is there a message
that I can send to the scroll box?
Thanks
Laurie.
|
|
| Back to top |
|
 |
KLinZ Guest
|
Posted: Sun Nov 16, 2003 11:43 am Post subject: Re: How to tell a scroll box to scroll |
|
|
In news:3fb74e2c (AT) dnews (DOT) tpgi.com.au, Laurie Boshell typed:
| Quote: | I have a TImage within a scroll box and the image is larger than the
scroll box so that scroll bars are present.
I have a mouse handler for TImage that tracks the cursor position
within TImage.
How do I tell the scroll box to scroll when the curson in the TImage
gets near the perimeter of the TImage (Say within 10 pixels)? Is
there a message that I can send to the scroll box?
|
You don't have to send a message. You can use the Position property of the
HorzScrollBar and VertScrollBar properties:
ScrollBox1.HorzScrollBar.Position := X;
ScrollBox1.VertScrollBar.Position := Y;
--
www.zenobits.com
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Sun Nov 16, 2003 11:56 am Post subject: Re: How to tell a scroll box to scroll |
|
|
On Sun, 16 Nov 2003 21:14:59 +1100, "Laurie Boshell"
<laurie (AT) pnc (DOT) com.au> wrote:
| Quote: | I have a TImage within a scroll box and the image is larger than the scroll
box so that scroll bars are present.
I have a mouse handler for TImage that tracks the cursor position within
TImage.
How do I tell the scroll box to scroll when the curson in the TImage gets
near the perimeter of the TImage (Say within 10 pixels)? Is there a message
that I can send to the scroll box?
|
I think you need to look at the ScrollBy method
It could be a bit tricky, you'll need to keep track of what direction
the mouse moved, and as you scroll the TImage, that will trigger
further mouse movement
|
|
| Back to top |
|
 |
|