Mike Lewis
Programmer
I have a form with a vertical scrollbar. I want to be able to scroll the form programmatically, but can't figure out how to do it.
To elaborate ...
I am adding objects to a form by drag and drop. As each object is dropped, I position it below the previous object, which might place it below the visible area of the form. In order to see it, the user can use the vertical scroll bar. That's all working fine.
What I now want to do is to enable the user to see the new object as soon as it is in position, without having to manually scroll. In other words, I want to programmatically scroll the form downward by an amount equal to the height of the new object.
This is what I have done so far:
This correctly scrolls the form by 10 pixels, but the newly added object is not visible. I just see a blank space where the object should be. However, if I then use the scrollbar to scroll, even by just a single pixel, the new object becomes visible.
I don't understand why this is happening this way, and what I am doing wrong. If anyone come help me out, I'd appreciate it.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
My Visual FoxPro site: www.ml-consult.co.uk
To elaborate ...
I am adding objects to a form by drag and drop. As each object is dropped, I position it below the previous object, which might place it below the visible area of the form. In order to see it, the user can use the vertical scroll bar. That's all working fine.
What I now want to do is to enable the user to see the new object as soon as it is in position, without having to manually scroll. In other words, I want to programmatically scroll the form downward by an amount equal to the height of the new object.
This is what I have done so far:
Code:
WITH thisform
.setViewPort(.ViewPortLeft, .ViewPortTop + 10)
ENDWITH
This correctly scrolls the form by 10 pixels, but the newly added object is not visible. I just see a blank space where the object should be. However, if I then use the scrollbar to scroll, even by just a single pixel, the new object becomes visible.
I don't understand why this is happening this way, and what I am doing wrong. If anyone come help me out, I'd appreciate it.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
My Visual FoxPro site: www.ml-consult.co.uk