Board index » delphi » Newbie TScrollBox Question

Newbie TScrollBox Question

Hello,
I have an app. in Delphi 4 Client/Server thats using a ScrollBox on a Form.
I'm using mouse events to pickup and move a TPanel based component. The
component is picked up and moved without a problem. Then the mouse position
is stored in a Paradox Table for retrieval after the app has been restarted.
The position is stored correctly in the Table(x and y match what they were
set at before shutting down the app), however when the app is restarted the
component is drawn in the wrong position on the ScrollBox. I've noticed this
only happens when the component is moved to an area of the ScrollBox where
the scrollbars have to kick in. If I drag several of the components down
below the ScrollBox area and drop them, they will end up on top of one
another  when the app is restarted. I'm new to using ScrollBox's does anyone
have an idea of what I'm doing wrong?

Thanks for your time.......
Dennis

 

Re:Newbie TScrollBox Question


On Tue, 22 Jun 1999 17:50:26 -0700, "Dennis" <den...@mailink.net>
wrote:

Quote
>I have an app. in Delphi 4 Client/Server thats using a ScrollBox on a Form.
>I'm using mouse events to pickup and move a TPanel based component. The
>component is picked up and moved without a problem. Then the mouse position
>is stored in a Paradox Table for retrieval after the app has been restarted.
>The position is stored correctly in the Table(x and y match what they were
>set at before shutting down the app), however when the app is restarted the
>component is drawn in the wrong position on the ScrollBox. I've noticed this
>only happens when the component is moved to an area of the ScrollBox where
>the scrollbars have to kick in. If I drag several of the components down
>below the ScrollBox area and drop them, they will end up on top of one
>another  when the app is restarted.

I've seen something similar to this, so I can vouch for your sanity.
Unfortunately, I've never had a chance to really sit down and figure
out exactly what was going on.

If you can reduce the problem down to just a few simple steps and a
few lines of code, I'd be happy to look at it.

-Steve

Re:Newbie TScrollBox Question


Make sure that you are storing the Top and Left properties of the
components, and that you are storing what you track with your mouse
position.

If the problem persists, try in-stepping your code during creation, to see
what makes the components drift.

The problem you may be having is that you keep your components in the bottom
of the ScrollBox, but you have nothing near the Top. I do not quite recall
if this was so, but I think the scroll bars disappear if there is nothing to
scroll up to. If this is what's happening, then when your component gets the
focus, it is scrolled into sight - the scrollbox gets updated - the
scrollbars are gone - the component seems to be at the bottom of the
scrollbox.

Marcelo Lopez Ruiz

Quote
Steve Schafer (TeamB) wrote in message <37985c4f.40946...@90.0.0.40>...
>On Tue, 22 Jun 1999 17:50:26 -0700, "Dennis" <den...@mailink.net>
>wrote:

>>I have an app. in Delphi 4 Client/Server thats using a ScrollBox on a
Form.
>>I'm using mouse events to pickup and move a TPanel based component. The
>>component is picked up and moved without a problem. Then the mouse
position
>>is stored in a Paradox Table for retrieval after the app has been
restarted.
>>The position is stored correctly in the Table(x and y match what they were
>>set at before shutting down the app), however when the app is restarted
the
>>component is drawn in the wrong position on the ScrollBox. I've noticed
this
>>only happens when the component is moved to an area of the ScrollBox where
>>the scrollbars have to kick in. If I drag several of the components down
>>below the ScrollBox area and drop them, they will end up on top of one
>>another  when the app is restarted.

>I've seen something similar to this, so I can vouch for your sanity.
>Unfortunately, I've never had a chance to really sit down and figure
>out exactly what was going on.

>If you can reduce the problem down to just a few simple steps and a
>few lines of code, I'd be happy to look at it.

>-Steve

Other Threads